15 Linux general interview questions with answers, Part 1
Correct answers are provided with full care for all the interview questions.
1.) What is Unix?
It is an operating system which is designed for both efficient multi-tasking and multi-user function.
Unix is primarily a command-line operating system with additional applications to give it a graphic oriented operating system similar to Microsoft Windows.
2.) What is UMASK?
UMASK controls the default permission given to a new file or a directory when they are created on a Linux machine. The default umask values for the Bash shell users are defined in the following /etc/profile and /etc/bashrc files. Users can override the system defaults in their “. bash_profile” and “. bashrc files”.
3.) How to change the default run level in Linux?
To change the default run level, we have to edit the file “/etc/inittab” or In the case of systemd it uses ‘targets’ instead of run levels. For example systemctl set-default TARGET.target
4.) Which command would you use if you want to remove the password assigned to a group?
gpasswd command with -r option removes the password from the group
5.) Tell me commands which you know to view the contents of any file in Linux?
6.) Which file is generally used to configure kickstart?
The file used to configure kickstart is anaconda.cfg
7.) What is the purpose of the swapon command?
swapon command is used in Linux to activate an already created swap partition for paging and swapping
8.) What are the three values shown in the load average section of top command?
The first value shows current, second value 5 minute back and third value 15 minute back average load
9.) Which account is created automatically on Linux installation?
A super user account called ‘root’ is created with Linux installation.
10.) Which log file will you check for all authentication related messages?
11.) Why should you avoid Telnet to administer a Linux system remotely?
Telnet isn’t used because of lack of security.It sends data across the network in plain text format which can be read easily to find out the password. It has been replaced almost everywhere by OpenSSH
12.) How to find the bit size of your Linux system?
uname -m command is used to find out bit size of the Linux system
13.) Can you tell me the difference between a soft link and a hard link?
A file in the file system is basically a link to an inode.
When we create a hard link a new file is created with a link to the same underlying inode while Softlink is a shortcut link to the original file.
Hard link files have same inode numbers while soft link size is equal to null.
Changes done in any file which is hard link will reflect changes across all the files while in soft link if the original file is deleted then it’s shortcut will not work.
In the case of hard link If one file is deleted, it won’t affect the other file while in soft link if you delete shortcut it won’t affect the original file.
14.) How do you create a new user account?
We can create a new user account in Linux by using useradd command.
15.) Why are some file names preceded by a dot in Linux?
In Linux, the filenames which are preceded by a dot are called hidden files.
That’s all for now. How these interview questions helped you, post them in the comments.