Linux interview Question- Learn Devops in Kannada
Basics First Basics First
71 subscribers
24 views
1

 Published On Sep 28, 2024

Linux Interview Questions

1. Find file that are older than 30 days?
to find: "find . type -f -mtime +30"
to find and delete: "find . type -f -mtime +30 -delete"

2. what is the difference between du and df
du (Disk Usage):
Purpose: Reports the amount of disk space used by files and directories.

df (Disk Free):
Purpose: Reports the amount of free and used space on file systems.

4. What is the difference between set and cut
Purpose: The set command is used to set or unset shell options and positional parameters in shell

Purpose: The cut command is used to extract specific sections (fields) from a line of text, typically used when working with data in a file or input stream.

4. what is the difference between head and tail
a. head Command:
Purpose: Displays the beginning (first few lines) of a file.
Default Behavior: By default, head shows the first 10 lines of a file.

b. tail Command:
Purpose: Displays the end (last few lines) of a file.
Default Behavior: By default, tail shows the last 10 lines of a file.

5. what is the difference between softlink and hardlink

In Linux, both soft links (symbolic links) and hard links are ways to create links to files, but they differ in how they operate and how they reference the original file.

a. Soft Link (Symbolic Link):
Definition: A soft link, or symbolic link, is a pointer to another file. It contains the path to the original file, but it does not duplicate the actual file data.

b. Hard Link:
Definition: A hard link is essentially another name for the same file on the disk. It references the same inode (i.e., the actual data blocks) as the original file, making both the original file and the hard link indistinguishable.

6. Default file permissions
- Non-root user - 664
- root user - 644

7. Default directory permissions
- Non-root user - 775
- root user - 755

8. what is the Command to check cpu, ram and disk size
cpu - lscpu
ram - free -h
disk - df -h
9. what is the default port of ssh
- 22
10. what is the default port of telnet
- 23
11. What is the command to create tar and untar file
Tar: tar -cvf tar_filename.tar source
Untar: tar -xvf tar_filename.tar

#shell
#shellscripting
#function
#shellscriptingfunctions
#operators
#arrays in Bash
#bash Array Tutorial
#shellscripting Array Example
#linux Bash Arrays
#arraymanipulation
#shellscripting #bash #array #programming
#scriptinglanguage
#Bash Programming Arrays
#How to Use Arrays in Shell Script
#Shell Scripting for Beginners
#Shell Script Array Basics
#Bash Array Methods
#Bash Array Loop Tutorial
#Bash Array Declaration

show more

Share/Embed