Linux top 200+ Interview Question Answers

Introduction to Linux OS

Linux is a free and open-source operating system based on the Unix operating system. It was first created in 1991 by Linus Torvalds and has since grown to become one of the most widely used operating systems in the world. Linux is known for its stability, security, and flexibility, making it a popular choice for servers, supercomputers, and embedded systems. It is also widely used as a desktop operating system, particularly in the field of software development. One of the main advantages of Linux is its open-source nature, which means that the source code is freely available for anyone to view, modify, and distribute. This has led to a large and active community of developers who contribute to the ongoing development of the operating system, creating a vast array of software tools and applications.

Question 1. When you login you get “$” prompt, what is the prompt for root?
Answer : #

Question 2. Explain the difference between grep and egrep?
Answer : grep and egrep are both command-line utilities in Linux used for searching text files for patterns. The main difference between them is the type of regular expressions they support.

Question 3. What is the port # for DNS, NTP and NFS?
Answer : 53,123 and 111/2049

Question 4. What is the configuration file name of DNS and where is it located?
Answer : /etc/named.conf

Question 5. How many new directories will be created after running the following command mkdir {a..c}{1..3}
Answer : 9

Question 6. Your PC is configured with a DNS server address but not the default gateway. Can the PC access internet?
Answer : No

Question 7. What is the difference between IP and Gateway?
Answer : IP (Internet Protocol) address is a unique numerical identifier assigned to each device on a network. A Gateway, on the other hand, is a network node that serves as an access point to another network.

Question 8. Can you assign one static IP to 2 computers, if not then why?
Answer : No because it will create IP conflict

Question 9. How to change IPs address to static?
Answer : ifconfig x.x.x.x

Question 10. You are trying to ping a server by hostname and you get an error message, “ping: unknown host …”. What could be the reason and how to solve the problem so you can ping it by hostname?
Answer : Check for /etc/hosts or DNS to see if it has hostname to IP entry

Question 11. Explain the difference between relative and absolute path?
Answer : Absolute path starts from / where relative path is your current directory

Question 12. List 3 different methods of adding user?
Answer : Using the useradd Command , Using the adduser Command, Using a Graphical User Interface

Question 13. What is the command to change file/directory ownership and group?
Answer : chown and chgrp

Question 14. List any 3 type of filesystem?
Answer : ext4,NTFS and FAT

Question 15. When you login you get a message on the screen. What is the name of that file and where is it located?
Answer : /etc/motd

Question 16. What is /bin directory used for?
Answer :  It stands for “binary” and it contains essential binary executables that are used by both the system and its users.

Question 17. What are the different types of DNS Server
Answer : Master and secondary

Question 18. How to change a user password?
Answer : passwd username

Question 19. What is the version of Redhat Linux you have experience with?
Answer : 7.4

Question 20. List any 4 linux distributions?
Answer : Redhat, CentOS, Ubuntu and SUSE

Question 21. How to logoff from the system?
Answer : exit

Question 22. Give any 3 examples of operating systems?
Answer : Windows, Linux and MAC

Question 23. How to create a directory?
Answer : mkdir

Question 24. Where are the zone files located for DNS service?
Answer : /var/named/zonefiles

Question 25. How to check kernel version?
Answer : uname –a

Question 26. Which directory has all the configuration files?
Answer : /etc

Question 27. How to become root user from a regular user?
Answer : su –

Question 28. How many mega bytes in 1 giga bytes?
Answer : There are 1024 megabytes (MB) in one gigabyte (GB).

Question 29. What is the purpose of having different network ports?
Answer : So the communication of each application goes through a dedicated port

Question 30. How to display first column of a file?
Answer : cat filename | awk ‘{print $1}’

Question 31. What is the name of DNS rpm package?
Answer : bind

Question 32. What is the difference between nslookup and dig commands?
Answer : nslookup is a legacy tool that has been around since the early days of DNS.dig is a newer and more advanced tool that provides more detailed information about DNS queries

Question 33. How to check your user id and group id?
Answer : id

Question 34. How to check a file’s permission?
Answer : ls –l

Question 35. What is the difference between “kill” and “kill -9” command?
Answer : The kill command sends a signal to a process, which can be used to request that the process terminates gracefully.the kill -9 command sends the SIGKILL signal to a process, which immediately terminates the process without allowing it to perform any cleanup actions

Question 36. What is subnet?
Answer : A subnet (short for subnetwork) is a smaller network within a larger network that is created by dividing a single network into multiple smaller networks.

Question 37. You are troubleshooting an issue with Redhat support and they have asked you to send the contents of /etc directory. How and which method you will use to transfer the contents?
Answer : tar (compress) the entire /etc directory and ftp

Question 38. What is root home directory?
Answer : /root

Question 39. What is rsyslogd deamon and its purpose?
Answer : rsyslogd is a system daemon that is responsible for receiving and processing system logs on Linux systems. It is a more modern and feature-rich replacement for the older syslogd daemon.

Question 40. Your company has terminated a server administrator. What is first thing as an administrator you should do to enhance the security?
Answer : Change root password

Question 41. How to check the computer name or host name in Linux?
Answer : hostname

Question 42. Which permission allows a user to run an executable with the permissions of the owner of that file?
Answer : First 3 bits should have x

Question 43. What is the command to untar a tarred file?
Answer : untar

Question 44. What is /proc directory used for?
Answer : The /proc directory in Linux is a virtual filesystem that provides an interface to various system and process information as well as configuration parameters.

Question 45. What is the purpose of nsswitch.conf file
Answer : It tells the system where to go to resolve hostnames

Question 46. List 3 basic commands to navigate the filesystem?
Answer : cd, pwd and ls

Question 47. Which service/daemon should be running on the server that allows you to connect remotely?
Answer : sshd

Question 48. What is the purpose of firewall?
Answer : A firewall acts as a barrier between a trusted internal network and an untrusted external network, such as the internet, and monitors and controls incoming and outgoing network traffic based on a set of predefined rules.

Question 49. List any 3 IT components?
Answer : Hardware, OS and Applications

Question 50. Which directory has all the commands we use, e.g. ls, cd etc.?
Answer : /usr/bin or /bin

Also Read:

Question 51. What is the difference between memory, virtual memory and cache?
Answer : Memory, virtual memory, and cache are all different types of storage used in computer systems, with different purposes and characteristics.

Question 52. Which of the following is correct?
a. Hardware -> Operating System -> Users
b. Operating System -> Users -> Hardware
c. Database -> Hardware -> Users

Answer : Hardware -> Operating System -> Users

Question 53. Which of the following is a communication command?
o grep
o mail
o touch
o cd

Answer :mail

Question 54. How to rename a file or directory?
Answer : mv

Question 55. How to change a hostname in Linux?
Answer : hostname

Question 56. How to check network interfaces in Linux?
Answer : ifconfig

Question 57. Why is “tail –f logfilename” command used most often and what does it do?
Answer : It will output all incoming logs in real time

Question 58. What type of hardware have you worked on?
Answer : You should get yourself familiar with Dell, HP and UCS hardware by going online and check the vendor websites

Question 59. How to sort a file in reverse order?
Answer : cat filename | sort –r

Question 60. What is the name of operating system that runs Unix?
Answer : Solaris, HP-UX etc.

Question 61. List all byte sizes from smallest to largest?
Answer :Bit (b) – the smallest unit of storage, representing a single binary digit (either 0 or 1)

Nibble – a unit of storage that represents 4 bits (half a byte)

Byte (B) – a unit of storage that represents 8 bits

Kilobyte (KB) – a unit of storage that represents 1,024 bytes (2^10 bytes)

Megabyte (MB) – a unit of storage that represents 1,048,576 bytes (2^20 bytes)

Gigabyte (GB) – a unit of storage that represents 1,073,741,824 bytes (2^30 bytes)

Terabyte (TB) – a unit of storage that represents 1,099,511,627,776 bytes (2^40 bytes)

Petabyte (PB) – a unit of storage that represents 1,125,899,906,842,624 bytes (2^50 bytes)

Exabyte (EB) – a unit of storage that represents 1,152,921,504,606,846,976 bytes (2^60 bytes)

Zettabyte (ZB) – a unit of storage that represents 1,180,591,620,717,411,303,424 bytes (2^70 bytes)

Yottabyte (YB) – a unit of storage that represents 1,208,925,819,614,629,174,706,176 bytes (2^80 bytes)

Question 62. How to check the total number of partition in Linux?
Answer : fdisk -l

Question 63. How to access a linux system from a linux system?
Answer : ssh

Question 64. Explain the procedure of bonding 2 NICs or interfaces together?
Answer : 

  • Install the bonding driver:
  • Create a bond interface
  • Configure the bond interface
  • Configure the physical NICs
  • Restart the network service

Question 65. What is the exact command syntax to list the 5th column of a file and cut the first 3 letters?
Answer : cat filename | awk ‘{print $5}’ | cut –c1-3

Question 66. What is /etc/hosts file used for?
Answer : To resolve hostnames with IP address

Question 67. List any 3 options of ‘df’ command and what they are used for?
Answer :

  • -h or --human-readable: This option prints the output in a human-readable format, which means that the sizes are displayed in units that are easier to understand, such as megabytes (MB) and gigabytes (GB), rather than the default units of 1,024-byte blocks.
  • -T or --print-type: This option displays the filesystem type in the output. This can be useful for identifying the type of filesystem that is being used on a particular partition or device.
  • -i or --inodes: This option displays the inode usage information for the filesystem. An inode is a data structure used by the filesystem to store information about files and directories,

Question 68. What is the command to change file/directory permissions?
Answer : chmod

Question 69. What is the purpose of pipe (|)?
Answer : To combine multiple commands

Question 70. What is /etc directory used for?
Answer : For configuration files

Question 71. Which command is used to list files in a directory?
Answer : ls –l

Question 72. There is a command which gives you information about other commands, please explain that command and what is it used for?
Answer : man

Question 73. How to delete a file and a directory?
Answer : rm filename and rmdir dirname

Question 74. What is the difference between “tail” and “tail -10”?
Answer : None

Question 75. List 4 commands to display or read a file contents?
Answer : cat, more, less, vi

Question 76. Which command is used to read the top 5 lines of a file?
Answer : head -5 filename

Question 77. What are the different commands or methods to write to a file?
Answer : echo > filename and vi filename

Question 78. What is swap space and how to check swap space?
Answer : Swap space is a type of virtual memory that is used by the operating system to temporarily move data from the physical memory (RAM) to the hard disk when the RAM is full. free command is used to check the swap space.

Question 79. What is inode and how to find an inode of a file?
Answer : Inode (short for index node) is a data structure used in the file system of Unix and Unix-like operating systems to store information about a file or directory.

Question 80. Which file to edit for kernel tuning?
Answer : The file used for kernel tuning may vary depending on the Linux distribution and version. However, one of the most commonly used files for kernel tuning is /etc/sysctl.conf

Question 81. What is the latest version of Redhat?
Answer : 9.x

Question 82. Name the command to find specific word from a file?
Answer : grep word filename

Question 83. You have scheduled a job using crontab but it does not run at the time you specified, what could be the reason and how would you troubleshoot?
Answer : Check your system time
Check your crontab entry
Check /var/log/messages

Question 84. How to check system hardware information?
Answer : dmidecode

Question 85. How to check network interface MAC address?
Answer : ifconfig

Question 86. If I don’t want others to read my file1, how to do that?
Answer : Remove r from the last 3 bits of file permission

Question 87. What is the purpose of “uniq” and “sed” command?
Answer : The uniq command is used to filter out adjacent duplicate lines from a text file or input stream. The sed command, short for “stream editor”, is a powerful text editor that can be used to modify and transform text data in a file or input stream.

Question 88. Which command is used to list the contents of a directory in the most recent time and in reverse order, meaning the most updated file should be listed on the bottom?
Answer : ls –ltr

Question 89. What is the difference between tar, gzip and gunzip?
Answer : tar: The tar command is used to create an archive file from a group of files or directories. The gzip command is used to compress a file and create a compressed version of it. The gunzip command is used to decompress a file that has been compressed with gzip.

Question 90. What are the different ways to install and OS?
Answer : DVD, DVD iso and network boot

Question 91. How to view difference between two files?
Answer : diff file1 and file2

Question 92. You noticed that one of the Linux servers has no disk space left, how would you troubleshoot that issue?
Answer : If running LVM then add more disk and extend LVM
If not running LVM then add more disk, create a new partition and link the new partition to an existing filesystem

Question 93. How to check Redhat version release?
Answer : uname –a or /etc/redhat-release

Question 94. What is the difference between TCP and UDP?
Answer : TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two of the most widely used protocols for transmitting data over the internet.

Question 95. What is a zombie process?
Answer : A zombie process is a process that has completed execution but still has an entry in the process table. A zombie process occurs when a child process completes execution, but its parent process has not yet called the wait() system call to read its exit status.

Question 96. How do you search for a pattern/word in a file and then replace it in an entire file?
Answer : sed command

Question 97. Explain the purpose of “touch” command?
Answer : To create an empty file

Question 98. If a command hangs, how to stop it and get the prompt back?
Answer : Ctrl C

Question 99. Which command is used to count words or lines?
Answer : wc

Question 100. How to check the number of users logged in?
Answer : who

Also Read:

Question 101. What is the command to view the calendar of 2011?
Answer : cal 2011

Question 102. Which command is used to view disk space?
Answer : df –h

Question 103. How to create a new group in Linux?
Answer : groupadd

Question 104. What is the command to send a message to everyone who is logged into the system?
Answer : wall

Question 105. Which command is used to check total number of disks?
Answer : fdisk –l

Question 106. What is an mail server record in DNS?
Answer : MX

Question 107. What does the following command line do?
ps -ef | awk ‘{print $1}’ | sort | uniq

Answer : List the first column of all running processes, sort them and remove duplicates

Question 108. You get a call that when a user goes to it fails and gets an error, how do you troubleshoot?
Answer : Check for user internet
Check to see if user computer has DNS for hostname lookup
Check to see if the server is up that is running that website
Check to see if the server’s web service is running
Check for DNS availability which is resolving that website

Question 109. List 4 different directories in /?
Answer : /etc, /bin, /tmp, /home

Question 110. What is the output of the following command: $tail -10 filename | head -1
Answer : It will show the first line from the last 10 lines of a file

Question 111. What are the different fields in /etc/passwd file?
Answer : The fields are:

  • Username: The login name for the user.
  • Password: An “x” or “*” character indicating that the user’s password is stored in the /etc/shadow file, which is accessible only by the root user.
  • User ID (UID): A unique numeric identifier assigned to the user.
  • Group ID (GID): The primary group identifier assigned to the user.
  • User Info: Additional information about the user, such as their full name, location, or contact details.
  • Home directory: The user’s home directory, which is the default directory that the user is placed in after logging in.
  • Login shell: The user’s default shell, which is the program that is run when the user logs in.

Question 112. Which command is used to list the processes?
Answer : ps –ef

Question 113. What is the difference between “hostname” and “uname” commands?
Answer : Hostname will give you system name and uname will give you OS information

Question 114. How to check system load?
Answer : top and uptime command

Question 115. How to schedule jobs?
Answer : crontab and at

Question 116. What is the 3rd field when setting up crontab?
Answer : Day of the month

Question 117. What is the command to create a new user?
Answer : useradd

Question 118. What is the “init #” for system reboot?
Answer : 6

Question 119. How to restart a service?
Answer : systemctl restart servicename

Question 120. How to shutdown a system?
Answer : shutdown or init 0

Question 121. What is “ftp” command used for?
Answer : To transfer files from one computer to another

Question 122. Explain cron job syntax? First is minute, second is..?
Answer : Min, house, day of the month, month, day of the week and command

Question 123. How to delete a package in Linux?
Answer : rpm –e packagename

Question 124. What is the file name where user password information is saved?
Answer : /etc/shadow

Question 125. Which command you would use to find the location of chmod command?
Answer : which chmod

Question 126. Which command is used to check if the other computer is online?
Answer : ping othercomputer

Question 127. Please explain about LAN, MAN and WAN?
Answer : LAN (Local Area Network): A LAN is a type of computer network that covers a small area, such as a building or campus. A MAN is a computer network that covers a larger geographic area than a LAN but smaller than a WAN. A WAN is a type of computer network that covers a large geographic area, such as a country or multiple countries.

Question 128. How to list hidden files in a directory?
Answer : ls –la

Question 129. What is the difference between telnet and ssh?
Answer : ssh is secure where telnet is not

Question 130. How to run a calculator on Linux and exit out of it?
Answer : bc and quit

Question 131. List any 4 commands to monitor system?
Answer : top, df –h, iostat, dmesg

Question 132. You are notified that your server is down, list the steps you will take to troubleshoot?
Answer : Check the system physically
Login through system console
Ping the system
Reboot or boot if possible

Question 133. What is difference between static and DHCP IP?
Answer : A static IP address is manually assigned to a device on the network, which means that the address remains the same over time. DHCP stands for Dynamic Host Configuration Protocol, which is a protocol used to automatically assign IP addresses to devices on a network.

Question 134. How to write in vi editor mode?
Answer : i = insert, a = insert in next space, o = insert in new line

Question 135. What is the difference between “crontab” and “at” jobs?
Answer : crontab is for repetitive jobs where at is for one time job

Question 136. What is vCenter server in VMWare?
Answer : VMware vCenter Server is a centralized management software for virtual infrastructure. It allows administrators to manage multiple virtual machines (VMs) and hosts from a single console.

Question 137. What is “dmidecode” command used for?
Answer : To get system information

Question 138. What is the difference between SAN and NAS?
Answer : A SAN is a specialized high-speed network that provides block-level storage to servers. SANs are typically used in enterprise-level environments and provide high-performance, scalable, and reliable storage solutions. A NAS, is a file-level storage system that is connected to a network and provides shared file access to multiple clients. NAS systems are generally easier to set up and manage than SANs and are commonly used in smaller environments.

Question 139. What is the location of system logs? E.g. messages
Answer : /var/log directory

Question 140. How to setup an alias and what is it used for?
Answer : alias aliasname=”command”
It is used to created short-cuts for long commands

Question 141. What is the purpose of “netstat” command?
Answer : The “netstat” (network statistics) command is a built-in utility tool in most operating systems that provides information about the network connections and network statistics. It is used to display active network connections (both incoming and outgoing), routing tables, and network interface statistics.

Question 142. What are terminal control keys, list any 3?
Answer : Crtl C, D and Z

Question 143. Which command(s) you would run if you need to find out how many processes are running on your system?
Answer : ps –ef | wc –l

Question 144. What are the different types of shells?
Answer : sh, bash, ksh, csh etc.

Question 145. How to delete a line when in vi editor mode?
Answer : dd

Question 146. Which is the core of the operating system?
a) Shell
b) Kernel
c) Commands
d) Script

Answer :Kernal

Question 147. Which among the following interacts directly with system hardware?
a) Shell
b) Commands
c) Kernel
d) Applications

Answer : Shell

Question 148. How to save and quit from vi editor?
Answer : Shift ZZ or :wq!

Question 149. What is the difference between a process and daemon?
Answer : A process is an instance of a program that is being executed on a computer system. A process is created when a program is started and is terminated when the program is finished. A daemon is a background process that runs continuously on a computer system, performing certain tasks or providing certain services.

Question 150. What is the process or daemon name for NTP?
Answer : ntpd

Also Read:

Question 151. What are a few commands you would run if your system is running slow?
Answer : top, iostat, df –h, netstat etc.

Question 152. How to install a package in Redhat Linux?
Answer : yum install packagename

Question 153. What is the difference between “ifconfig” and “ipconfig” commands?
Answer : ifconfig for Linux and ipconfig for Windows

Question 154. What is the first line written in a shell script? Define shell
Answer : e.g. #!/bin/bash

Question 155. Where is the network (Ethernet) file located, please provide exact directory location and file name?
Answer : /etc/sysconfig/network-scripts/ifcfg-nic

Question 156. Why do we use “last” command?
Answer : To see who has logged in the system whether active or logged off

Question 157. What is RHEL Linux stands for?

Question 158. To view your command history, which command is used and how to run a specific command?
Answer : history and history #

Question 159. What is NTP and briefly explain how does it work and where is the config files and related commands of NTP?
Answer : NTP (Network Time Protocol) is a protocol used to synchronize the clocks of computer systems over a network.

Some commonly used NTP-related commands include:

  • ntpq: Used to query an NTP server for time information and status.
  • ntpdate: Used to set the system time manually or to synchronize the system clock with an NTP server.
  • chronyc: A command-line tool used to configure and monitor the NTP daemon.

Question 160. How to disable firewall in Linux?
Answer : ufw stop

Question 161. How to configure mail server relay for sendmail service?
Answer : Edit /etc/mail/ file and add SMART_HOST entry

Question 162. Where is samba log file located?
Answer : /var/log/samba

Question 163. What is mkfs command used for?
Answer : To create a new filesystem

Question 164. If you create a new group, which file does it get created in?
Answer : /etc/group

Question 165. Which file has DNS server information (e.g. DNS resolution)?
Answer : /etc/resolv.conf

Question 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)?
Answer : rpm –qi http

Question 167. On the file permissions? What are the first 3 bits for and who is it for?
Answer : Read, write and execute. They are used for the owner of the file

Question 168. How to create a soft link?
Answer : ln –s

Question 169. How to write a script to delete messages in a log file older than 30 days automatically?
Answer : 

Question 170. How to quit out of “man” command?
Answer : q

Question 171. Which command is used to partition disk in Linux?
Answer : fdisk

Question 172. What is the difference between “shutdown” and “halt” command?
Answer : shutdown is used to safely shut down or reboot a system, while halt is used to power off or halt a system immediately without performing any shutdown procedures.

Question 173. What is the exact syntax of mounting NFS share on a client and also how to un-mount?
Answer : To mount an NFS share on a client, you can use the mount command with the following syntax:

mount -t nfs <server_ip>:/<remote_directory> <local_directory>

To un-mount an NFS share, use the umount command with the following syntax:

umount <local_directory>

Question 174. What experience do you have with scripting, explain?
Answer : if-the, do-while, case, for loop scripts

Question 175. How to get information on all the packages installed on the system?
Answer : rpm –qa

Question 176. Explain VMWare?
Answer : VMware is a software virtualization technology that allows multiple operating systems to run on a single physical host machine. It was developed by VMware, Inc. and is one of the most popular virtualization solutions available in the market.

Question 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?
Answer : grep for error, warning, failure etc. in /var/log/messages file

Question 178. What is /etc/fstab file and explain each column of this file?
Answer : The /etc/fstab file is a system configuration file used by Linux and other Unix-like operating systems to define how file systems should be mounted and used during the boot process. It contains information about file systems that are mounted at boot time, including their device names, mount points, and mount options.

The /etc/fstab file is structured as follows:

<file system> – This column specifies the device name or file system type that will be mounted. This can be a partition name like /dev/sda1, or a file system type like nfs.

<mount point> – This column specifies the directory on the file system where the device or file system type specified in the first column should be mounted. This is typically a directory like /mnt/data or /home.

<file system type> – This column specifies the type of file system that is being mounted, such as ext4 or nfs.

<mount options> – This column specifies any additional options that should be used when mounting the file system. For example, options like ro (read-only) or noexec (do not allow execution of binaries) can be specified here.

<dump> – This column is used by the dump backup program to determine whether a file system should be backed up. A value of 0 means that the file system should not be backed up, while a value of 1 means that it should.

<pass> – This column is used by the fsck program to determine the order in which file systems should be checked at boot time. File systems with a lower value in this column are checked before those with a higher value. Typically, the root file system is assigned a value of 1, while other file systems are assigned a value of 2 or higher.

Question 179. What the latest version of Windows server?
Answer : 2022

Question 180. What is the exact command to list only the first 2 lines of history output?
Answer :history | head -2

Question 181. How to upgrade Linux from 7.3 to 7.4?
Answer :yum install update

Question 182. How to tell which shell you are in or running?
Answer :$0

Question 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?
Answer :– – – – – – – r – x

Question 184. What is CNAME record in DNS?
Answer :Entry for hostname to hostname

Question 185. What is the name of VMWare operating system?
Answer :ESXi

Question 186. What is the client name used to connect to ESXi or vCenter server?
Answer :vSphere client

Question 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?
Answer :Give write permission on the first 3 bits

Question 188. What is the latest version of VMWare?
Answer : 8

Question 189. What is the name of firewall daemon in Linux?
Answer : firewalld

Question 190. Which command syntax you can use to list only the 20th line of a file?
Answer : You can use the sed command with the -n and p options to print a specific line number of a file.

Question 191. What is the difference between run level 3 and 5?
Answer : 3 = Boot system with networking, 5 = boot system with networking and GUI

Question 192. List a few commands that are used in troubleshooting network related issue?
Answer : netstat, tcpdump etc.

Question 193. What is the difference between domain and nameserver?
Answer : A domain and a nameserver are two different things, but they are related to each other in the context of the Domain Name System (DNS), which is used to translate human-readable domain names into IP addresses that computers can understand.

Question 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?
Answer : more or less

Question 195. How to start a new shell. E.g. start a new ksh shell?
Answer : Simply type ksh, or bash

Question 196. How to kill a process?
Answer : kill processID

Question 197. How to check scheduled jobs?
Answer : crontab –l

Question 198. How to check system memory and CPU usage?
Answer : free and top

Question 199. Which utility could you use to repair the corrupted file system?
Answer : fsck

Question 200. What is the command to make a service start at boot?
Answer : systemctl enable servicename

Also Read:

Question 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
Answer : cat fileA >> fileB

Question 202. What is echo command used for?
Answer : To output to a screen

Question 203. What does the following command do?
Answer : 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”

Question 204. Which file to modify to allow users to run root commands
Answer : /etc/sudoers

Question 205. You need to modify httpd.conf file but you cannot find it, Which command line tool you can use to find file?
Answer : find / -name “httpd.conf”

Question 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?
Answer : The /boot file is most likely corrupted

, , , , , , , , , , , , , , , , , ,

Leave a Reply