Linux Technical Interview Questions Part-4
151. What are a few commands you would run if your system is running
slow?
top, iostat, df –h, netstat etc.
152. How to install a package in Redhat Linux?
yum install packagename
153. What is the difference between “ifconfig” and “ipconfig”
commands?
ifconfig for Linux and ipconfig for Windows
154. What is the first line written in a shell script?
Define shell
e.g. #!/bin/bash
155. Where is the network (Ethernet) file located, please provide
exact directory location and file name?
/etc/sysconfig/network-scripts/ifcfg-nic
156. Why do we use “last” command?
To see who has logged in the system whether active or logged off
157. What is RHEL Linux stands for?
Search online
158. To view your command history, which command is used and how to
run a specific command?
history and history #
159. What is NTP and briefly explain how does it work and where is the
config files and related commands of NTP?
Search online
160. How to disable firewall in Linux?
Search online
161. How to configure mail server relay for sendmail service?
Edit /etc/mail/sendmail.mc file and add SMART_HOST entry
162. Where is samba log file located?
/var/log/samba
163. What is mkfs command used for?
To create a new filesystem
164. If you create a new group, which file does it get created in?
/etc/group
165. Which file has DNS server information (e.g. DNS resolution)?
/etc/resolv.conf
166. What are the commands you would run if you need to find out the
version and build date of a package (e.g. http)?
rpm –qi http
167. On the file permissions? What are the first 3 bits for and who is
it for?
Read, write and execute. They are used for the owner of the file
168. How to create a soft link?
ln –s
169. How to write a script to delete messages in a log file older than
30 days automatically?
Search online
170. How to quit out of “man” command?
q
171. Which command is used to partition disk in Linux?
fdisk
172. What is the difference between “shutdown” and “halt” command?
Search online
173. What is the exact syntax of mounting NFS share on a client and
also how to un-mount?
Search online
174. What experience do you have with scripting, explain?
if-the, do-while, case, for loop scripts
175. How to get information on all the packages installed on the
system?
rpm –qa
176. Explain VMWare?
Search online
177. You are tasked to examine a log file in order to find out why a
particular application keep crashing. Log file is very lengthy,
which command can you use to simplify the log search using a
search string?
grep for error, warning, failure etc. in /var/log/messages file
178. What is /etc/fstab file and explain each column of this file?
Search online
179. What the latest version of Windows server?
Search online
180. What is the exact command to list only the first 2 lines of
history output?
history | head -2
181. How to upgrade Linux from 7.3 to 7.4?
yum install update
182. How to tell which shell you are in or running?
$0
183. You have tried to “cd” into a directory but you have been denied.
You are not the owner of that directory, what permissions do you
need and where?
- - - - - - - r – x
184. What is CNAME record in DNS?
Entry for hostname to hostname
185. What is the name of VMWare operating system?
ESXi
186. What is the client name used to connect to ESXi or vCenter
server?
vSphere client
187. You get a call from a user saying that I cannot write to a file
because it says, permission denied. The file is owned by that
user, how do you troubleshoot?
Give write permission on the first 3 bits
188. What is the latest version of VMWare?
Search online
189. What is the name of firewall daemon in Linux?
firewalld
190. Which command syntax you can use to list only the 20th line of a
file?
Search online
191. What is the difference between run level 3 and 5?
3 = Boot system with networking, 5 = boot system with networking
and GUI
192. List a few commands that are used in troubleshooting network
related issue?
netstat, tcpdump etc.
193. What is the difference between domain and nameserver?
Search online
194. You open up a file and it has 3000 lines and it scrolled up
really fast, which command you will use to view it one page at a
time?
more or less
195. How to start a new shell. E.g. start a new ksh shell?
Simply type ksh, or bash
196. How to kill a process?
kill processID
197. How to check scheduled jobs?
crontab –l
198. How to check system memory and CPU usage?
free and top
199. Which utility could you use to repair the corrupted file system?
fsck
200. What is the command to make a service start at boot?
systemctl enable servicename
201. How to combine 2 files into 1? E.g. you 3 lines in file “A” and 5
lines in file “B”, which command syntax to use that will combine
into one file of 3+5 = 8 lines
cat fileA >> fileB
202. What is echo command used for?
To output to a screen
203. What does the following command do?
echo This year the summer will be great > file1
It will create a new file “file1” with the content as “This year
the summer will be great”
204. Which file to modify to allow users to run root commands
/etc/sudoers
205. You need to modify httpd.conf file but you cannot find it, Which
command line tool you can use to find file?
find / -name “httpd.conf”
206. Your system crashed and being restarted, but a message appears,
indicating that the operating system cannot be found. What is the
most likely cause of the problem?
The /boot file is most likely corrupted
0 Comments