Linux Interview tips to remember

Linux Interview tips to remember

 

1) What command is used to remove the password assigned to a group?

A) gpasswd -r

The gpasswd command is used to change the password assigned to a group. Use the -r option to remove the password from the group.

passwd -d <groupname>

2) What is the minimum number of partitions you need to install Linux? What command can you use to review boot messages?

A) USR.OPT, ROOT, BOOT, SWAP,

3) Which file defines all users on your system? Choose one: a. /etc/passwd b. /etc/users c. /etc/password d. /etc/user.conf

A) The /etc/passwd file contains all the information on users who may log into your system. If a user account is not contained in this file, then the

4) What is kernel updation?

A) kernel updation is a process to upgrade the kernel file with a new or latest version of kernel & use of them as a default kernel.

5) What command can you use to review boot messages?

A) dmesg

6) You locate a command in the /bin directory but do not know what it does. What command can you use to determine its purpose?

A) whatis. The whatis command displays a summary line from the man page for the specified command. We can use man and info commands

7) What file defines the levels of messages written to system log files?

A) kernel.h. To determine the various levels of messages that are defined on your system, examine the kernel.h file.

8) You want to create a compressed backup of the users’ home directories. What utility should you use?

A) tar.  You can use the z modifier with tar to compress your archive at the same time as creating it. tar -zcvf filename.tgz file1 file2. This command is used to take a compress backup

9) You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility.

A) zcat. The zcat utility allows you to examine the contents of a compressed file much the same way that cat displays a file. grep is preffered over zcat

10) You suspect that you have two commands with the same name as the command is not producing the expected results. What command can you use to determine the location of the command being run?

A) which. The which command searches your path until it finds a command that matches the command you are looking for and displays its full path

11) What account is created when you install Linux?

A) root. Whenever you install Linux, only one user account is created. This is the superuser account also known as root.

12) You have a file called phone nos that is almost 4,000 lines long. What text filter can you use to split it into four pieces each 1,000 lines long?

A) split. The split text filter will divide files into equally sized pieces. The default length of each piece is 1,000 lines.

13) Which file do you need to change to alter how the updatedb database is created?

A)  /etc/updatedb.conf. The /etc/updatedb.conf file is used to manage the creation of the updatedb database.

14) You wish to restore the file memo.ben which was backed up in the tarfile MyBackup.tar. What command should you type?

A) tar xf MyBackup.tar memo.ben. This command uses the x switch to extract a file. Here the file memo.ben will be restored from the tarfile MyBackup.tar.

15) After creating a backup of the users’ home directories called backup.cpio you are asked to restore a file called memo.ben. What command should you type?

A) cpio -if backup.cpio memo.ben. The i tells cpio to extract, F specifies the archive to examine and the file to extract is memo.ben.