Linux System Administrator Interview Questions You'll Most Likely Be Asked
Linux System Administrator Interview Questions You'll Most Likely Be Asked
LINUX SYSTEM
ADMINISTRATOR
INTERVIEW QUESTIONS
YOU'LL MOST LIKELY BE ASKED
296
Interview Questions
Linux System
Administrator
Interview Questions
You'll Most Likely Be Asked
ISBN-10: 1-946383-15-5
ISBN-13: 978-1-946383-15-0
Vibrant Publishers books are available at special quantity discount for sales
promotions, or for use in corporate training programs. For more information
please write to [email protected]
chapter 7 Scripts 61
HR Interview Questions 79
Index 105
Dear Reader,
Thank you for purchasing Linux System Administrator Interview Questions You'll Most
Likely Be Asked. We are committed to publishing books that are content-rich, concise and
approachable enabling more readers to read and make the fullest use of them. We hope this
book provides the most enriching learning experience as you prepare for your interview.
Thanks again for your purchase. Good luck with your interview!
facebook.com/vibrantpublishers
Linux System
Administrator
Interview Questions
Review these typical interview questions and think about how you would
answer them. Read the answers listed; you will find best possible answers
along with strategies and suggestions.
www.vibrantpublishers.com
This page is intentionally left blank
Chapter 1
General Tools
1: You want to find all of the “.tmp” files in /home/* and delete
them, how can you do it in a command?
Answer:
First you need to find the files using find, then delete them using
rm- find /home/ -name ‘*.tmp’ | xargsrm –rf.
www.vibrantpublishers.com
8 Linux System Administrator Interview Questions You’ll Most Likely Be Asked
5: How can you list the arp cache table of the current machine?
Answer:
You can use the command arp to control and view the arp table.
6: How can you eject your CDROM drive from the console?
Answer:
In order to eject the CDROM drive, you can use the command
eject.
facebook.com/vibrantpublishers
General Tools 9
10: You have 100 .txt files in a directory, you want to know in
which file you have the string “Error Found”, how can you do it?
Answer:
You will need to use the command “grep” in order to find data in
files - grep “Error Found” *.txt
13: How will you create a tar file ‘MyTar.tar’ from the directory
‘MyTarFiles’ (which has many files)?
Answer:
A Tar file is the compressed format of collection of files, which
could be created with the following tar command:
tar -cfMyTar.tar MyTarFiles
In the above command
a) ‘MyTar.tar’ refers to the file name
b) ‘MyTarFiles’ refers to the directory or folder which contains
the list of files
c) –c will create an archive
d) f allows to specify the archive file name
14: How can you know, without checking the logs, which Kernel
version is currently loaded to the system?
Answer:
The uname tool allows you to get various system information - to
get only the kernel data, you can use uname –rsv.
facebook.com/vibrantpublishers
General Tools 11
17: How do you make sure that your computer date & time are
always aligned?
Answer:
You need to connect your server to a ntp server using ntpd, or run
manually “ntptime ntpserver.com”
20: How can you get the current username that you are logged in
with?
Answer:
You can find the user that you are logged in with, using the
www.vibrantpublishers.com
12 Linux System Administrator Interview Questions You’ll Most Likely Be Asked
21: Using the apt-get application, how can you install gcc
compiler?
Answer:
The apt-get allows you to download and install new applications
like gcc - apt-get install gcc
23: How can you find all lines starting with the word “Error” in
the log file “mylog.log”, with a single command?
Answer:
The Linux command look allows you to find only lines beginning
with the provided string - look Error mylog.log
24: You have a file that you want to randomize its lines and
create permutations of it for distinctive file list, how can you
create a permutation of the file “myfile” into “mynewfile”?
Answer:
The Linux tool shuf allows you to create permutations of file and
shuffle the lines, which will allow you to create new distinctive
files - shufmyfile>mynewfile.
facebook.com/vibrantpublishers
General Tools 13
25: You have moved a file from one server to another, but you
are not sure that the file has been perfectly moved, how can you
verify that the file has not been corrupted?
Answer:
You can use the md5sum tool on both sides (both servers) on the
file and match the result, if it is the same, the file has not been
corrupted.
26: How would you copy the file “file.txt” owned by root using
secure ftp from 10.1.1.1 on /root/ to your local folder in one
command?
Answer:
You need to use the scp tool (secure copy over sftp) which allows
copying in one line [email protected]:/root/file.txt ./
28: How can you check how long is the system running since the
last restart and the load average on it?
Answer:
The uptime command can show you the current time, how long the
system has been running since the last restart, how many users are
currently logged on to the system, and the system load averages in
the resolution of the last 1, 5, and 15 minutes.
www.vibrantpublishers.com
14 Linux System Administrator Interview Questions You’ll Most Likely Be Asked
29: How can you check what processes a specified user (tom) is
currently running?
Answer:
ps command will output the current processes of all or specific
users - ps -U tom.
30: How can you see all the running processes at the system and
their resources use on a live auto-refreshing view?
Answer:
Top lets you see all the processes in the system and sort them by
resources usage.
facebook.com/vibrantpublishers
General Tools 15
37: How can you search for the word “FindMe” in all of the “.txt”
files in the current directory, recursively?
Answer:
Find . -name "*.txt" | xargsgrep "FindMe"
www.vibrantpublishers.com
16 Linux System Administrator Interview Questions You’ll Most Likely Be Asked
facebook.com/vibrantpublishers
This page is intentionally left blank