Linux Interview Questions
-
- What is the purpose of the 'grep' command in Linux?
- The 'grep' command is used to search for specific patterns within text files. It stands for "global regular expression print."
- Explain the difference between 'ls' and 'ls -l' commands.
- 'ls' lists the files and directories in the current directory, while 'ls -l' provides a detailed listing including file permissions, owner, size, and modification date.
- How do you change permissions for a file in Linux?
- You can change permissions using the 'chmod' command followed by the permission codes for user, group, and others. For example, 'chmod 755 filename' grants read, write, and execute permissions to the owner and read/execute permissions to the group and others.
- What is the purpose of the 'tar' command in Linux?
- The 'tar' command is used to create, view, and extract files from tar archives. It stands for "tape archive."
- How do you find out the current disk usage in Linux?
- You can use the 'df' command to display disk space usage on all mounted file systems or 'du' command to show disk usage for specific files or directories.
- What is the purpose of the 'ps' command in Linux?
- The 'ps' command is used to display information about active processes running on the system, including their process IDs (PIDs), CPU and memory usage, and other details.
- How do you kill a process in Linux?
- You can kill a process using the 'kill' command followed by the process ID (PID) or by using 'killall' followed by the process name.
- What is a symbolic link in Linux?
- A symbolic link, also known as a symlink, is a special type of file that points to another file or directory. It acts as a shortcut or reference to the target file or directory.
- How do you find and replace text in a file using the command line?
- You can use the 'sed' command (stream editor) to find and replace text in a file. For example, 'sed -i 's/old_text/new_text/g' filename' will replace all occurrences of 'old_text' with 'new_text' in the file 'filename'.
- Explain the difference between '&&' and '||' operators in Linux shell scripting.
- '&&' is a logical AND operator used to execute the command following it only if the previous command succeeds, while '||' is a logical OR operator used to execute the command following it only if the previous command fails.
Interested about Linux?
Get in touch with training experts Get Free QuotesLeave a commentLatest Jobs in US & Canada
Interview Questions
Popular Tutorials
Most students read these articles
Recommended Courses
Upload your resume
Resume Uploaded Successfully !!
Job profiles get interview calls from top companies Create job profile