Anda di halaman 1dari 8

Top 100 Linux interview questions

1. 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.
. You create a new user account by adding the following line to your /etc/passwd
file. bobm:baddog:!"1:!"1:#ob $orris:/home/bobm:/bin/bash #ob calls you and
tells you that he cannot logon. You %erify that he is using the correct username
and password. What is the problem? Choose one: a. The &'( and )'( cannot be
identical. b. You cannot ha%e spaces in the line unless they are surrounded with
double *uotes. c. You cannot directly enter the password+ rather you ha%e to use
the passwd command to assign a password to the user. d. The username is too
short, it must be at least si- characters long.
.. Which of the following tasks is not necessary when creating a new user by editing
the /etc/passwd file? Choose one: a. Create a link from the user/s home directory
to the shell the user will use. b. Create the user/s home directory c. &se the
passwd command to assign a password to the account. d. 0dd the user to the
specified group.
1. You create a new user by adding the following line to the /etc/passwd file
bobm::!"1:!"1:#ob $orris:/home/bobm:/bin/bash You then create the user/s
home directory and use the passwd command to set his password. 2owe%er, the
user calls you and says that he cannot log on. What is the problem? Choose one:
a. The user did not change his password. b. bobm does not ha%e permission to
/home/bobm. c. The user did not type his username in all caps. d. You cannot
lea%e the password field blank when creating a new user.
!. When using useradd to create a new user account, which of the following tasks is
not done automatically. Choose one: a. 0ssign a &'(. b. 0ssign a default shell. c.
Create the user/s home directory. d. (efine the user/s home directory.
3. You issue the following command useradd 4m bobm #ut the user cannot logon.
What is the problem? Choose one: a. You need to assign a password to bobm/s
account using the passwd command. b. You need to create bobm/s home directory
and set the appropriate permissions. c. You need to edit the /etc/passwd file and
assign a shell for bobm/s account. d. The username must be at least fi%e
characters long.
5. You ha%e created special configuration files that you want copied to each user/s
home directories when creating new user accounts. You copy the files to /etc/skel.
Which of the following commands will make this happen? Choose one: a. useradd
4m username b. useradd 4mk username c. useradd 4k username d. useradd 4(k
username
6. $ary has recently gotten married and wants to change her username from mstone
to mknight. Which of the following commands should you run to accomplish
this? Choose one: a. usermod 4l mknight mstone b. usermod 4l mstone mknight c.
usermod 4u mknight mstone d. usermod 4u mstone mknight
7. 0fter bob lea%es the company you issue the command userdel bob. 0lthough his
entry in the /etc/passwd file has been deleted, his home directory is still there.
What command could you ha%e used to make sure that his home directory was
also deleted? Choose one: a. userdel 4m bob b. userdel 4u bob c. userdel 4l bob d.
userdel 4r bob
1". 0ll groups are defined in the /etc/group file. 8ach entry contains four fields in the
following order. Choose one: a. groupname, password, )'(, member list b. )'(,
groupname, password, member list c. groupname, )'(, password, member list d.
)'(, member list, groupname, password
11. You need to create a new group called sales with #ob, $ary and 9oe as members.
Which of the following would accomplish this? Choose one: a. 0dd the following
line to the /etc/group file: sales:11:bob,mary,:oe b. 'ssue the command groupadd
sales. c. 'ssue the command groupadd 4a sales bob,mary,:oe d. 0dd the following
line to the /etc/group file: sales::11:bob,mary,:oe
1. What command is used to remo%e the password assigned to a group?
1.. You changed the )'( of the sales group by editing the /etc/group file. 0ll of the
members can change to the group without any problem e-cept for 9oe. 2e cannot
e%en login to the system. What is the problem? Choose one: a. 9oe forgot the
password for the group. b. You need to add 9oe to the group again. c. 9oe had the
original )'( specified as his default group in the /etc/passwd file. d. You need to
delete 9oe/s account and recreate it.
11. You need to delete the group datapro:ect. Which two of the following tasks
should you do first before deleting the group? 0. Check the /etc/passwd file to
make sure no one has this group as his default group. #. Change the members of
the datapro:ect group to another group besides users. C. $ake sure that the
members listed in the /etc/group file are gi%en new login names. (. ;erify that no
file or directory has this group listed as its owner. Choose one: a. 0 and C b. 0
and ( c. # and C d. # and (
1!. When you look at the /etc/group file you see the group kmem listed. <ince it does
not own any files and no one is using it as a default group, can you delete this
group?
13. When looking at the /etc/passwd file, you notice that all the password fields
contain =-/. What does this mean? Choose one: a. That the password is encrypted.
b. That you are using shadow passwords. c. That all passwords are blank. d. That
all passwords ha%e e-pired.
15. 'n order to impro%e your system/s security you decide to implement shadow
passwords. What command should you use?
16. What file contains the default en%ironment %ariables when using the bash shell?
Choose one: a. >/.profile b. /bash c. /etc/profile d. >/bash
17. You ha%e created a subdirectory of your home directory containing your scripts.
<ince you use the bash shell, what file would you edit to put this directory on your
path? Choose one: a. >/.profile b. /etc/profile c. /etc/bash d. >/.bash
". Which of the following interprets your actions when typing at the command line
for the operating system? Choose ?ne a. &tility b. 0pplication c. <hell d.
Command
1. What can you type at a command line to determine which shell you are using?
. You want to enter a series of commands from the command4line. What would be
the *uickest way to do this? Choose ?ne a. @ress enter after entering each
command and its arguments b. @ut them in a script and e-ecute the script c.
<eparate each command with a semi4colon A+B and press enter after the last
command d. <eparate each command with a / and press enter after the last
command
.. You are entering a long, comple- command line and you reach the right side of
your screen before you ha%e finished typing. You want to finish typing the
necessary commands but ha%e the display wrap around to the left. Which of the
following key combinations would achie%e this? Choose ?ne a. 8sc, /, 8nter b. /,
8nter c. ctrl4d, enter d. esc, /, ctrl4d
1. 0fter typing in a new command and pressing enter, you recei%e an error message
indicating incorrect synta-. This error message originated from.. Choose one a.
The shell b. The operating system c. The command d. The kernel
!. When typing at the command line, the default editor is the CCCCCCCCCCCCC
library.
3. You typed the following at the command line ls 4al /home/ hadden. What key
strokes would you enter to remo%e the space between the =// and =hadden/ without
ha%ing to retype the entire line? Choose one a. Ctrl4#, (el b. 8sc4b, (el c. 8sc4
(el, (el d. Ctrl4b, (el
5. You would like to temporarily change your command line editor to be %i. What
command should you type to change it?
6. 0fter e-perimenting with %i as your command line editor, you decide that you
want to ha%e %i your default editor e%ery time you log in. What would be the
appropriate way to do this? Choose one a. Change the /etc/inputrc file b. Change
the /etc/profile file c. Change the >/.inputrc file d. Change the >/.profile file
7. You ha%e to type your name and title fre*uently throughout the day and would
like to decrease the number of key strokes you use to type this. Which one of your
configuration files would you edit to bind this information to one of the function
keys?
.". 'n your present working directory, you ha%e the files maryletter memo1
$yTelephoneand0ddress#ook What is the fewest number of keys you can type
to open the file $yTelephoneand0ddress#ook with %i? Choose one a. 3 b. 6 c.
! d. 1
.1. 0 %ariable that you can name and assign a %alue to is called a CCCCCCCCCCCCC
%ariable.
.. You ha%e installed a new application but when you type in the command to start it
you get the error message Command not found. What do you need to do to fi- this
problem? Choose one a. 0dd the directory containing the application to your path
b. <pecify the directory/s name whene%er you run the application c. ;erify that
the e-ecute permission has been applied to the command. d. )i%e e%eryone read,
write and e-ecute permission to the application/s directory.
... You telnet into se%eral of your ser%ers simultaneously. (uring the day, you
sometimes get confused as to which telnet session is connected to which ser%er.
Which of the following commands in your .profile file would make it ob%ious to
which ser%er you are attached? Choose one a. @<1D/Eh: EwF/ b. @<1D/Es: EWF/ c.
@<1D/EG: EtF/ d. @<1D/Ea: EnF/
.1. Which of the following en%ironment %ariables determines your working directory
at the completion of a successful login? Choose one a. 2?$8 b. #0<2C8H; c.
@W( d. #I8H(8J('J
.!. 8%ery time you attempt to delete a file using the rm utility, the operating system
prompts you for confirmation. You know that this is not the customary beha%ior
for the rm command. What is wrong? Choose one a. rm has been aliased as rm 4i
b. The %ersion of rm installed on your system is incorrect. c. This is the normal
beha%ior of the newest %ersion of rm. d. There is an incorrect link on your system.
.3. You are running out of space in your home directory. While looking for files to
delete or compress you find a large file called .bashChistory and delete it. 0 few
days later, it is back and as large as before. What do you need to do to ensure that
its siKe is smaller? Choose one a. <et the 2'<TL'I8<'M8 %ariable to a smaller
number. b. <et the 2'<T<'M8 to a smaller number. c. <et the H?2'<TL'I8
%ariable to true. d. <et the 2'<T0@@8H( %ariable to true.
.5. 'n order to display the last fi%e commands you ha%e entered using the history
command, you would type CCCCCCCCCCC.
.6. 'n order to display the last fi%e commands you ha%e entered using the fc
command, you would type CCCCCCCCCCC.
.7. You pre%iously ran the find command to locate a particular file. You want to run
that command again. What would be the *uickest way to do this? Choose one a.
fc 4l find fc n b. history 4l find history n c. Jetype the command d. fc 4n find
1". &sing command substitution, how would you display the %alue of the present
working directory? Choose one a. echo NApwdB b. echo pwd c. Npwd d. pwd O echo
11. You need to search the entire directory structure to locate a specific file. 2ow
could you do this and still be able to run other commands while the find command
is still searching for your file? Choose one a. find / 4name filename P b. find /
4name filename c. bg find / 4name filename d. Pfind / 4name filename P
1. 'n order to create a file called (irContents containing the contents of the /etc
directory you would type CCCCCCCCCCCC.
1.. What would be displayed as the result of issuing the command ps ef? Choose one
a. 0 listing of the user/s running processes formatted as a tree. b. 0 listing of the
stopped processes c. 0 listing of all the running processes formatted as a tree. d. 0
listing of all system processes formatted as a tree.
11. What utility can you use to show a dynamic listing of running processes?
CCCCCCCCCC
1!. The top utility can be used to change the priority of a running process? 0nother
utility that can also be used to change priority is CCCCCCCCCCC?
13. What key combination can you press to suspend a running :ob and place it in the
background?
15. You issue the command :obs and recei%e the following output: Q1R4 <topped Atty
outputB pine QRS <topped Atty outputB $y<cript 2ow would you bring the
$y<cript process to the foreground? Choose one: a. fg T b. ctrl4c c. fg $y<cript
d. ctrl4K
16. You enter the command cat $yLile O sort F (irIist P and the operating system
displays Q1R .177 What does this mean? Choose one a. This is :ob number 1 and
the @'( of the sort command is .177. b. This is :ob number 1 and the @'( of the
:ob is .177. c. This is :ob number .177 and the @'( of the cat command is 1. d.
This is :ob number 1 and the @'( of the cat command is .177.
17. You attempt to log out but recei%e an error message that you cannot. When you
issue the :obs command, you see a process that is running in the background. 2ow
can you fi- this so that you can logout? Choose one a. 'ssue the kill command
with the @'( of each running command of the pipeline as an argument. b. 'ssue
the kill command with the :ob number as an argument. c. 'ssue the kill command
with the @'( of the last command as an argument. d. 'ssue the kill command
without any arguments.
!". You ha%e been gi%en the :ob of administering a new ser%er. 't houses a database
used by the sales people. This information is changed fre*uently and is not
duplicated anywhere else. What should you do to ensure that this information is
not lost? Choose one a. Create a backup strategy that includes backing up this
information at least daily. b. @repare a proposal to purchase a backup ser%er c.
Jecommend that the ser%er be made part of a cluster. d. 'nstall an additional hard
dri%e in the ser%er.
!1. When planning your backup strategy you need to consider how often you will
perform a backup, how much time the backup takes and what media you will use.
What other factor must you consider when planning your backup strategy?
CCCCCCCCC
!. $any factors are taken into account when planning a backup strategy. The one
most important one is how often does the file CCCCCCCCCCCC.
!.. Which one of the following factors does not play a role in choosing the type of
backup media to use? Choose one: a. 2ow fre*uently a file changes b. 2ow long
you need to retain the backup c. 2ow much data needs to be backed up d. 2ow
fre*uently the backed up data needs to be accessed
!1. When you only back up one partition, this is called a CCCCCC backup. Choose one
a. (ifferential b. Lull c. @artial d. Copy
!!. When you back up only the files that ha%e changed since the last backup, this is
called a CCCCCC backup. Choose one a. @artial b. (ifferential c. Lull d. Copy
!3. The easiest, most basic form of backing up a file is to CCCCC it to another location.
!5. When is the most important time to restore a file from your backup? Choose one
a. ?n a regular scheduled basis to %erify that the data is a%ailable. b. When the
system crashes. c. When a user inad%ertently loses a file. d. When your boss asks
to see how restoring a file works.
!6. 0s a system administrator, you are instructed to backup all the users/ home
directories. Which of the following commands would accomplish this? Choose
one a. tar rf usersbkup home/U b. tar cf usersbkup home/U c. tar cbf usersbkup
home/U d. tar r%f usersbkup home/U
!7. What is wrong with the following command? tar c%fb / /de%/tape " Choose one
a. You cannot use the c option with the b option. b. The correct line should be tar
4c%fb / /de%/tape". c. The arguments are not in the same order as the
corresponding modifiers. d. The files to be backed up ha%e not been specified.
3". You need to %iew the contents of the tarfile called $y#ackup.tar. What command
would you use? CCCCCCCCCC
31. 0fter 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?
3. You want to create a compressed backup of the users/ home directories so you
issue the command gKip /home/U backup.gK but it fails. The reason that it failed is
that gKip will only compress one CCCCCCC at a time.
3.. You want to create a compressed backup of the users/ home directories. What
utility should you use?
31. You routinely compress old log files. You now need to e-amine a log from two
months ago. 'n order to %iew its contents without first ha%ing to decompress it,
use the CCCCCCCCC utility.
3!. Which two utilities can you use to set up a :ob to run at a specified time? Choose
one: a. at and crond b. atrun and crontab c. at and crontab d. atd and crond
33. You ha%e written a script called usrs to parse the passwd file and create a list of
usernames. You want to ha%e this run at ! am tomorrow so you can see the results
when you get to work. Which of the following commands will work? Choose one:
a. at !:"" wed usrs b. at !:"" wed 4b usrs c. at !:"" wed 4l usrs d. at !:"" wed 4d
usrs
35. <e%eral of your users ha%e been scheduling large at :obs to run during peak load
times. 2ow can you pre%ent anyone from scheduling an at :ob? Choose one: a.
delete the file /etc/at.deny b. create an empty file called /etc/at.deny c. create two
empty files: /etc/at.deny and /etc/at.allow file d. create an empty file called
/etc/at.allow
36. 2ow can you determine who has scheduled at :obs? Choose one: a. at 4l b. at 4* c.
at 4d d. atwho
37. When defining a cron:ob, there are fi%e fields used to specify when the :ob will
run. What are these fields and what is the correct order? Choose one: a. minute,
hour, day of week, day of month, month b. minute, hour, month, day of month,
day of week c. minute, hour, day of month, month, day of week d. hour, minute,
day of month, month, day of week
5". You ha%e entered the following cron:ob. When will it run? 1! U U U 1,.,! myscript
Choose one: a. at 1! minutes after e%ery hour on the 1st, .rd and !th of each
month. b. at 1:1! am, .:1! am, and !:1! am e%ery day c. at .:"" pm on the 1st,
.rd, and !th of each month d. at 1! minutes after e%ery hour e%ery $onday,
Wednesday, and Lriday
51. 0s the system administrator you need to re%iew #ob/s cron:obs. What command
would you use? Choose one: a. crontab 4lu bob b. crontab 4u bob c. crontab 4l d.
cron* 4lu bob
5. 'n order to schedule a cron:ob, the first task is to create a te-t file containing the
:obs to be run along with the time they are to run. Which of the following
commands will run the script $y<cript e%ery day at 11:1! pm? Choose one: a. U
. 1! U U $y<cript b. . 1! U U U $y<cript c. 1! . U U U $y<cript d. U U U .
1! $y<cript
5.. Which daemon must be running in order to ha%e any scheduled :obs run as
scheduled? Choose one: a. crond b. atd c. atrun d. crontab
51. You want to ensure that your system is not o%erloaded with users running
multiple scheduled :obs. 0 policy has been established that only the system
administrators can create any scheduled :obs. 't is your :ob to implement this
policy. 2ow are you going to do this? Choose one: a. create an empty file
called /etc/cron.deny b. create a file called /etc/cron.allow which contains the
names of those allowed to schedule :obs. c. create a file called /etc/cron.deny
containing all regular usernames. d. create two empty files called /etc/cron.allow
and /etc/cron.deny
5!. You notice that your ser%er load is e-ceptionally high during the hours of 1" am
to noon. When in%estigating the cause, you suspect that it may be a cron :ob
scheduled by one of your users. What command can you use to determine if your
suspicions are correct? Choose one: a. crontab 4u b. crond 4u c. crontab 4l d. crond
4l
53. ?ne of your users, #ob, has created a script to reinde- his database. How he has it
scheduled to run e%ery day at 1":." am. What command should you use to delete
this :ob. Choose one: a. crontab 4ru bob b. crontab 4u bob c. crontab 4du bob d.
crontab 4lu bob
55. What daemon is responsible for tracking e%ents on your system?
56. What is the name and path of the default configuration file used by the syslogd
daemon?
57. You ha%e made changes to the /etc/syslog.conf file. Which of the following
commands will cause these changes to be implemented without ha%ing to reboot
your computer? Choose one: a. kill <')2'HT Vcat /%ar/run/syslogd.pidV b. kill
<')2&@ Vcat /%ar/run/syslogd.pidV c. kill <')2&@ syslogd d. kill <')2'HT
syslogd
6". Which of the following lines in your /etc/syslog.conf file will cause all critical
messages to be logged to the file /%ar/log/critmessages? Choose one: a. U.Dcrit
/%ar/log/critmessages b. Ucrit /%ar/log/critmessages c. UDcrit /%ar/log/critmessages
d. U.crit /%ar/log/critmessages
61. You wish to ha%e all mail messages e-cept those of type info to the
/%ar/log/mailmessages file. Which of the following lines in your /etc/syslogd.conf
file would accomplish this? Choose one: a. mail.U+mailGDinfo
/%ar/log/mailmessages b. mail.U+mail.Dinfo /%ar/log/mailmessages c.
mail.U+mail.info /%ar/log/mailmessages d. mail.U+mail.GDinfo
/%ar/log/mailmessages
6. What is the name and path of the main system log?
6.. Which log contains information on currently logged in users? Choose one: a.
/%ar/log/utmp b. /%ar/log/wtmp c. /%ar/log/lastlog d. /%ar/log/messages
61. You ha%e been assigned the task of determining if there are any user accounts
defined on your system that ha%e not been used during the last three months.
Which log file should you e-amine to determine this information? Choose one:
a. /%ar/log/wtmp b. /%ar/log/lastlog c. /%ar/log/utmp d. /%ar/log/messages
6!. You ha%e been told to configure a method of rotating log files on your system.
Which of the following factors do you not need to consider? Choose one: a. date
and time of messages b. log siKe c. fre*uency of rotation d. amount of a%ailable
disk space
63. What utility can you use to automate rotation of logs?
65. You wish to rotate all your logs weekly e-cept for the /%ar/log/wtmp log which
you wish to rotate monthly. 2ow could you accomplish this. Choose one: a.
0ssign a global option to rotate all logs weekly and a local option to rotate the
/%ar/log/wtmp log monthly. b. 0ssign a local option to rotate all logs weekly and a
global option to rotate the /%ar/log/wtmp log monthly. c. $o%e the /%ar/log/wtmp
log to a different directory. Jun logrotate against the new location. d. Configure
logrotate to not rotate the /%ar/log/wtmp log. Jotate it manually e%ery month.
66. You ha%e configured logrotate to rotate your logs weekly and keep them for eight
weeks. You are running our of disk space. What should you do? Choose one: a.
Wuit using logrotate and manually sa%e old logs to another location. b.
Jeconfigure logrotate to only sa%e logs for four weeks. c. Configure logrotate to
sa%e old files to another location. d. &se the prerotate command to run a script to
mo%e the older logs to another location.
67. What command can you use to re%iew boot messages?
7". What file defines the le%els of messages written to system log files?
71. What account is created when you install Iinu-?
7. While logged on as a regular user, your boss calls up and wants you to create a
new user account immediately. 2ow can you do this without first ha%ing to close
your work, log off and logon as root? Choose one: a. 'ssue the command rootlog.
b. 'ssue the command su and type e-it when finished. c. 'ssue the command su
and type logoff when finished. d. 'ssue the command logon root and type e-it
when finished.
7.. Which file defines all users on your system? Choose one: a. /etc/passwd b.
/etc/users c. /etc/password d. /etc/user.conf
71. There are se%en fields in the /etc/passwd file. Which of the following lists all the
fields in the correct order? Choose one: a. username, &'(, )'(, home directory,
command, comment b. username, &'(, )'(, comment, home directory,
command c. &'(, username, )'(, home directory, comment, command d.
username, &'(, group name, )'(, home directory, comment
7!. Which of the following user names is in%alid? Choose one: a. Theresa 2adden b.
thadden c. Theresa2 d. T.2.
73. 'n order to pre%ent a user from logging in, you can add aAnB CCCCCCCCat the
beginning of the password field.
75. The beginning user identifier is defined in the CCCCCCCCC file.
76. Which field is used to define the user/s default shell?
77. #ob 0rmstrong, who has a username of boba, calls to tell you he forgot his
password. What command should you use to reset his command?
1"". Your company has implemented a policy that users/ passwords must be
reset e%ery ninety days. <ince you ha%e o%er 1"" users you created a file with
each username and the new password. 2ow are you going to change the old
passwords to the new ones? Choose one: a. &se the chpasswd command along
with the name of the file containing the new passwords. b. &se the passwd
command with the 4f option and the name of the file containing the new
passwords. c. ?pen the /etc/passwd file in a te-t editor and manually change each
password. d. &se the passwd command with the 4u option.

Anda mungkin juga menyukai