Linux System Administrator Interview Questions and Answers for Freshers

I have faced a number of interviews as a Linux Technical Support. I am sharing an interview question which has covered in my interview. You will definitely crack the interview by following questions.

1. What is default port number of ssh and HTTP.
ANS: ssh: 22 and HTTP: 80

2. What is the SMTP ?
ANS: SMTP is Simple Mail Transfer Protocol used to transfer mail.

3. What is Linux Kernel?
ANS: The Kernel has complete control over everything that occurs in the system.

4. What is default permission of File and Directory and How to change permissions.
ANS: Default permission of file is 644
          Default permission of Directory/Folder is 755

5. What is difference between Linux and Windows Operating System.
ANS: There are some differences between Linux and Windows OS.
  1. Linux is a command base. Windows is not command base.
  2. With Linux you have a centralized location where you can search for, add, or remove software but with Windows, you must know where to find the software you want to install, download the software and then execute that.exe file.
  3. Linux files are case sensitive. For example home.html and HOME.html are different. Windows is not case sensitive. For example home.html and HOME.html are same.
6. What is FTP.
ANS: FTP is a File Transfer Protocol. It is used to transfer file from one location to another location. FTP port number is 21.

7. What command is used with vi editor to save file and remain in the editing mode?
ANS: Use :w command to save and remain in exit mode. Use :wq command to save and exit mode. Use :q command to exit without change that you have edited.

8. How to change owner of File and Directory.
ANS: chown command is used to change ownership of File and Directory.
          Syntax: chown ownername filename
          Example. chown root
9. How you can create a folder and file using Terminal?
ANS: Use mkdir command to create Folder.
          Ex. mkdir abc
                Replace abc with your own Folder name.
          Use touch command to create file.
          Ex. touch abc.txt
                Replace abc.txt with your own file name.

10. Can we change ssh port number. What is configuration file of SSH.
ANS: Yes. We can change ssh port number. The configuration file of SSH is /etc/ssh/sshd_config 
         Default port number of SSH is 22. You can change 22 with port number as you wish.

11. What command is used to remove files and directory?
ANS: rmdir  command is used to remove empty Directory.
          rm command is used to remove file.

12. How do you change permission of File.
ANS: chmod command is used change permission of file.
13. What is the pwd command?
ANS: pwd means Present Working Directory. It is used to see the place where we are currently working.

14. What command is used to list contents of directories?
ANS: ls command is used to list the content of directory.

15. What is the command to calculate the size of a folder?
ANS: du command is used to calculate the size of a folder.

16. How to create an archive file in Linux Operating System?
ANS: tar command is used to archive files.

17. How can you check the memory status?
ANS: free command is used to check memory status.

18. What are the different modes when using vi editor?
ANS: There are 3 different modes when using vi editor.
  1. command mode
  2. insert mode
  3. exit mode
19. What would you use to view contents of the file?
ANS: cat command is used to see contents of file.

20. What is use of following commands.
     1. cd : This command is used to Change Directory.
     2. grep: grep prints matching pattern. grep searches files for lines containing a match to the given pattern.
     3. find: find command is used to find particular file.
     4. top: This command displays processor activity and displays task managed by Linux kernel.
     5. wc: wc means Word Count. wc is used to find number of new line count, word count,byte and characters in a file specified by the file argument.

Most Reading