Wednesday, November 9, 2011

Linux Interview Questions

Linux Interview Questions and Answers

What command can you use to review boot messages?
Ans: dmseg

What are seven fields in the /etc/passwd file.
Ans: Username:uid:groupname:gid:passwd:comment:home directory

You have two files in two different directories with the same inode. What type of link is involved?
Ans: Hard links

Which daemon controls the network service -> POP3 mail service? A) inetd B) pop3d C) maild D) nntpd E) pmaild
Ans: A - The inetd superdaemon

How to exclude ip address in dhcp? my ranges are 192.168.1.2 192.168.1.20 then how do i exclude different ip's like 192.168.1.4 and 7 and 10 from the range please help me out
Ans: subnet 192.168.1.0 netmask 255.255.255.0
{
range 192.168.1.2 192.168.1.3;
range 192.168.1.5 192.168.1.6;
range 192.168.1.8 192.168.1.9;
}

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one: a. The login command is missing. b. The username is too long. c. The password field is blank. d. The password field is prefaced by an asterick.
Ans: c

The password field must not be blank before converting to shadow passwords.
What daemon is responsible for tracking events on your system?
Ans: syslogd or rsyslogd

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?
Answer: tail -15 dog cat horse

Which file do you edit to set up a printer? A) /etc/printtab.conf B) /etc/print.conf C) /etc/lp.conf D) /etc/printtab E) /etc/printers
Answer: D - The file /etc/printab

Your default umask is 002. What does this mean? Choose one: a. Any file you create will have the permissions set as owner and group having read and write permissions; others as read only. b. Any file you create will have the permissions set as owner and group having read, write and execute permissions; others as read and execute. c. Any directoy you create will have the permissions set as owner and group having read, write and execute permissions; others as read and write permissions. d. Any directory you create will have the permissions set as owner and group having read and write permissions; others as read only.
Answer: A

If you type the command cat dog &> cat what would you see on your display? Choose one: a. Any error messages only. b. The contents of the file dog. c. The contents of the file dog and any error messages. d. Nothing as all output is saved to the file cat.
Answer: d

When typing at the command line, the default editor is the _____________ library.
Answer: readline
In order to improve your system's security you decide to implement shadow passwords. What command should you use?
Answer: pwconv

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this?
Ans: The password field must not be blank before converting to shadow passwords.

What account is created when you install Linux?
Answer: root

What is difference between AT and CRON?
Ans: Cron command is used to schedule the task daily at the same time repeatedly ,"at" command is used to schedule the task only once i.e to run only one time.

What command is used to remove the password assigned to a group?
Answer: gpasswd -r groupname

You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by checking the backup log but do not know how the directory structure was stored. What command can you use to determine this? Choose one: a. tar fx tarfile dirname b. tar tvf tarfile filename c. tar ctf tarfile d. tar tvf tarfile
Answer: d

Which of the following interprets your actions when typing at the command line for the operating system? Choose One a. Utility b. Application c. Shell d. Command
Answer: c

What key combination can you press to suspend a running job and place it in the background?
Answer: ctrl-z

What is contained in the directory /proc?
Choose one:

a. System information
b. Administrative procedures
c. Boot procedures
d. Documentation on your system
Answer: a

You would like to temporarily change your command line editor to be vi. What command should you type to change it?
Answer: set -o vi

Which partitioning tool is available in all distributions?
Answers: The fdisk

0 comments:

Powered by Blogger.