Interview Questions and Answers
Freshers / Beginner level questions & answers
Ques 1. What is the purpose of the 'chmod' command in Linux?
The 'chmod' command is used to change the permissions of a file or directory in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 2. Explain the difference between 'rm' and 'rmdir' commands.
'rm' is used to remove files, while 'rmdir' is used to remove empty directories.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 3. What is the role of the 'grep' command in Linux?
'grep' is used for searching patterns in files. It stands for 'Global Regular Expression Print.'
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 4. How do you check the free disk space in Linux?
The 'df' command is used to display the amount of disk space available on the file system.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 5. Explain the purpose of the 'ls' command.
'ls' is used to list files and directories in a directory.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 6. What is the purpose of the 'ps' command?
'ps' is used to display information about the currently running processes.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 7. How do you find the process ID (PID) of a running process?
The 'pgrep' or 'pidof' command can be used to find the PID of a running process.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 8. What is a symbolic link in Linux?
A symbolic link is a file that serves as a reference to another file or directory.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 9. Explain the purpose of the 'sudo' command.
'sudo' is used to execute commands with administrative or superuser privileges.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 10. What is the purpose of the 'tar' command?
'tar' is used to create and manipulate archive files.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Intermediate / 1 to 5 years experienced level questions & answers
Ques 11. How do you change the default shell for a user in Linux?
The 'chsh' command is used to change the default shell for a user.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 12. What is the significance of the '/etc/passwd' file?
The '/etc/passwd' file stores user account information, including usernames and home directories.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 13. How can you check the available memory in Linux?
The 'free' command is used to display the amount of free and used memory in the system.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 14. Explain the purpose of the 'cron' scheduler in Linux.
'cron' is a time-based job scheduler in Unix-like operating systems.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 15. What is the 'sudoers' file, and how do you edit it?
The 'sudoers' file contains information about who can run what commands as sudo. It can be edited using 'visudo.'
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 16. How do you find and kill a process using its port number?
The 'lsof' command can be used to find the process using a port, and 'kill' can be used to terminate it.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 17. What is the purpose of the 'grep' command with the '-v' option?
The '-v' option in 'grep' is used to invert the match, displaying lines that do not match the pattern.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 18. How do you recursively copy files and directories in Linux?
The 'cp' command with the '-r' or '-R' option can be used to copy files and directories recursively.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 19. What is the purpose of the 'awk' command in Linux?
'awk' is a powerful programming language mainly used for pattern scanning and processing.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Experienced / Expert level questions & answers
Ques 20. Explain the purpose of the 'iptables' command.
'iptables' is used to set up, maintain, and inspect the tables of IP packet filter rules in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 21. How do you find files larger than a specific size in Linux?
The 'find' command with the '-size' option can be used to find files larger than a specified size.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 22. What is a daemon in Linux?
A daemon is a background process that runs without direct user interaction.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 23. Explain the purpose of the 'chroot' command.
'chroot' is used to change the root directory for a specified command or shell.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 24. How do you check the status of a service in Linux?
The 'systemctl' command is used to check the status of a service in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 25. What is a shell script in Linux?
A shell script is a series of commands written in a script file to be executed by the shell.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 26. Explain the purpose of the 'umask' command.
'umask' is used to set the default file permissions for newly created files.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 27. How do you create a swap file in Linux?
The 'dd' command and 'mkswap' command are used to create a swap file in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 28. What is the purpose of the 'crontab' command?
'crontab' is used to create, view, and edit cron jobs in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 29. How do you find all files modified in the last 7 days?
The 'find' command with the '-mtime' option can be used to find files modified within a specific time frame.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 30. Explain the purpose of the 'rsync' command.
'rsync' is used for file synchronization and transfer between systems.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 31. What is the purpose of the 'ldconfig' command?
'ldconfig' is used to configure dynamic linker run-time bindings.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 32. How do you create a hard link in Linux?
The 'ln' command is used to create hard links in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 33. Explain the purpose of the 'journalctl' command.
'journalctl' is used to query and display messages from the journal, managed by 'systemd-journald' service.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 34. What is the purpose of the 'crash' command in Linux?
'crash' is used to analyze the Linux kernel core dumps.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 35. How do you change the hostname in Linux?
The 'hostnamectl' command is used to change the hostname in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 36. Explain the purpose of the 'journalctl' command.
'journalctl' is used to query and display messages from the journal, managed by 'systemd-journald' service.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 37. What is the purpose of the 'crash' command in Linux?
'crash' is used to analyze the Linux kernel core dumps.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 38. How do you change the hostname in Linux?
The 'hostnamectl' command is used to change the hostname in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 39. What is the purpose of the 'journalctl' command.
'journalctl' is used to query and display messages from the journal, managed by 'systemd-journald' service.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 40. What is the purpose of the 'crash' command in Linux?
'crash' is used to analyze the Linux kernel core dumps.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 41. How do you change the hostname in Linux?
The 'hostnamectl' command is used to change the hostname in Linux.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 42. What is the purpose of the 'journalctl' command.
'journalctl' is used to query and display messages from the journal, managed by 'systemd-journald' service.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Ques 43. What is the purpose of the 'crash' command in Linux?
'crash' is used to analyze the Linux kernel core dumps.
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Most helpful rated by users:
- What is the purpose of the 'chmod' command in Linux?
- Explain the difference between 'rm' and 'rmdir' commands.
- What is the role of the 'grep' command in Linux?
- Explain the purpose of the 'ls' command.
- Explain the purpose of the 'sudo' command.
Related differences
Related interview subjects
| Ubuntu interview questions and answers - Total 30 questions |
| Linux interview questions and answers - Total 43 questions |
| Unix interview questions and answers - Total 105 questions |
| Weblogic interview questions and answers - Total 30 questions |
| Tomcat interview questions and answers - Total 16 questions |
| Glassfish interview questions and answers - Total 8 questions |