0% found this document useful (0 votes)
32 views30 pages

Prep - 200+ Technical Questions

Uploaded by

Ezz Mahmoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views30 pages

Prep - 200+ Technical Questions

Uploaded by

Ezz Mahmoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Eng.

Ziad Shab Kalieh


@zsktech

1. Give any 3 examples of operating systems.


● Windows, Linux, and macOS.
2. What is the root home directory?
● The root home directory is /root.
3. Your company has terminated a server administrator. What is the first thing as an
administrator you should do to enhance the security?
● Change the root password.
4. How to check kernel version?
● Use the command uname -a.
5. How to become a root user from a regular user?
● Use su - or sudo su to switch to the root user.
6. How to check the computer name or hostname in Linux?
● Use the hostname command.
7. List 3 basic commands to navigate the filesystem.
● cd, pwd, and ls.
8. How to check network interfaces in Linux?
● Use ifconfig or ip addr or ip a
9. List 3 different methods of adding a user.
● Methods include using useradd, adduser, or manually editing
/etc/passwd and /etc/shadow files.

10. What is the command to create a new user?


● useradd username

11. How to change a user password?


● Use the command passwd username.
12. Which directory has all the configuration files?
● The /etc directory.
13. List any 4 Linux distributions.
● Kali, Red Hat, CentOS, Ubuntu, and SUSE.

in/harunseker/ 200+ Linux Technical Interview Questions 1


14. How to log off from the system?
● Use the exit command.
15. How to create a directory?
● Use the mkdir command.
16. Explain the purpose of the “touch” command.
● touch is used to create an empty file or update the timestamp of an
existing file.
17. If a command hangs, how to stop it and get the prompt back?
● Press Ctrl + C.
18. Which command is used to count words or lines?
● wc
19. How to rename a file or directory?
● Use the mv command.
20. How to change a hostname in Linux?
● Edit /etc/hostname and /etc/hosts, then restart the system or use
hostnamectl set-hostname newname.

21. What is the command to change file/directory permissions?


● Use chmod.
22. What is the purpose of pipe (|)?
● To pass the output of one command as input to another command.
23. What is /etc directory used for?
● It contains configuration files for the system.
24. Which command is used to list files in a directory?
● ls -l
25. There is a command which gives you information about other commands, please
explain that command and what is it used for?
● man is used to display the manual pages for other commands, providing
detailed information on usage and options.
26. How to delete a file and a directory?
● Use rm filename for files and rmdir dirname for directories.
27. What is the difference between “tail” and “tail -10”?

in/harunseker/ 200+ Linux Technical Interview Questions 2


● tail displays the last 10 lines of a file by default, while tail -10 explicitly
specifies to display the last 10 lines.
28. List 4 commands to display or read a file's contents.
● cat, more, less, vi.
29. Which command is used to read the top 5 lines of a file?
● head -5 filename
30. What are the different commands or methods to write to a file?
● echo > filename, vi filename, cat > filename.
31. What are the different types of shells?
● Sh, bash, ksh, csh, zsh
32. Which is the core of the operating system?
● Kernel
33. Which among the following interacts directly with system hardware?
● Kernel
34. List a few commands that are used in troubleshooting network-related issues?
● netstat: Displays network connections.
● tcpdump: Captures and analyzes network traffic.
● ping: Tests connectivity to another host.
● traceroute: Traces the route packets take to a network host.
35. How to combine 2 files into 1? E.g., you have 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 > combinedfile

36. What is the echo command used for?


● The `echo` command is used to display a line of text or output a string to
the screen.
37. What does the following command do?
● echo "This year the summer will be great" > file1

● It creates a new file named “file1” and writes the text “This year the
summer will be great” into it. If the file already exists, it will be overwritten.
38. When you login you get “$” prompt, what is the prompt for root?
● The prompt for the root user is typically #.

in/harunseker/ 200+ Linux Technical Interview Questions 3


39. Explain the difference between grep and egrep.
● grep is used for basic regular expression pattern matching, while egrep
(or grep -E) supports extended regular expressions, which allow more
complex pattern matching.
40. What is the port number for DNS, NTP, and NFS?
● DNS: 53, NTP: 123, NFS: 111 (portmapper) and 2049 (NFS).
41. What is the configuration file name of DNS and where is it located?
● The DNS configuration file is named named.conf and is typically located in
/etc.

42. How many new directories will be created after running the following command
mkdir {a..c}{1..3}?

● 9 directories will be created: a1, a2, a3, b1, b2, b3, c1, c2, c3.
43. Your PC is configured with a DNS server address but not the default gateway.
Can the PC access the internet?
● No, without a default gateway, the PC cannot access the internet.
44. What is the difference between IP and Gateway?
● An IP address is a unique identifier for a device on a network, while a
gateway is a network point that acts as an entrance to another network,
often used to connect local networks to external networks like the
internet.
45. Can you assign one static IP to 2 computers, if not then why?
● No, assigning the same static IP to two computers will create an IP
conflict, causing network communication issues.
46. How to change IP address to static?
● You can change the IP address to static by editing the network
configuration files, such as /etc/network/interfaces on Debian-based
systems or /etc/sysconfig/network-scripts/ifcfg-eth0 on Red
Hat-based systems, and setting the IP address manually.
● etc/netplan for the network configuration file on Ubuntu.

in/harunseker/ 200+ Linux Technical Interview Questions 4


47. 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?
● The issue could be due to a missing hostname-to-IP mapping in the
/etc/hosts file or an incorrect DNS configuration. Check and update

these files to resolve the issue.


48. Explain the difference between relative and absolute path.
● An absolute path starts from the root directory / and specifies the
complete path to a file or directory. A relative path is based on the current
directory and does not start with /.
49. What is the command to change file/directory ownership and group?
● Use chown to change ownership and chgrp to change the group.
50. List any 3 types of filesystem.
● ext4, NTFS, and FAT.
51. When you login you get a message on the screen. What is the name of that file
and where is it located?
● The file is /etc/motd (Message of the Day).
52. What is the /bin directory used for?
● The /bin directory contains essential binary executables needed for
booting and system repair.
53. What are the different types of DNS Server?
● Master (Primary) and Secondary (Slave) DNS servers.
54. Where are the zone files located for DNS service?
● Typically located in /var/named/zonefiles.
55. How many megabytes in 1 gigabyte?
● There are 1024 megabytes in 1 gigabyte.
56. What is the purpose of having different network ports?
● So the communication of each application goes through a dedicated port
● Different network ports allow multiple applications to communicate over
the network simultaneously without interference.
57. How to display the first column of a file?

in/harunseker/ 200+ Linux Technical Interview Questions 5


● Use cat filename | awk ‘{print $1}’
● awk '{print $1}' filename.
58. What is the name of the DNS rpm package?
● The package is called bind.
59. What is the difference between nslookup and dig commands?
● nslookup is a simple tool for querying DNS servers, while dig provides
more detailed information and is more flexible for DNS troubleshooting.
60. How to check your user id and group id?
● Use the id command.
61. What is the difference between “kill” and “kill -9” command?
● kill sends a signal to terminate a process gracefully, allowing it to clean
up resources. kill -9 sends a SIGKILL signal, forcing the process to
terminate immediately without cleanup.
62. What is a subnet?
● A subnet is a segmented piece of a larger network, designed to improve
performance and security by grouping devices with similar network
requirements.
63. You are troubleshooting an issue with Redhat support and they have asked you to
send the contents of /etc directory. How and which method will you use to
transfer the contents?
● Compress the /etc directory using tar and transfer it using ftp or scp.
64. What is rsyslogd daemon and its purpose?
● rsyslogd is a system utility providing support for message logging. It is an
enhanced version of syslogd.
65. What is the command to untar a tarred file?
● Use tar -xvf filename.tar.
66. What is the /proc directory used for?
● The /proc directory contains virtual files that provide a view into the
kernel's view of the system.
67. What is the purpose of the nsswitch.conf file?

in/harunseker/ 200+ Linux Technical Interview Questions 6


● It specifies the sources from which to obtain name-service information in
a range of categories and in what order.
68. Which service/daemon should be running on the server that allows you to
connect remotely?
● sshd (SSH Daemon).
69. What is the purpose of a firewall?
● A firewall controls incoming and outgoing network traffic based on
predetermined security rules.
70. List any 3 IT components.
● Hardware, Operating System, and Applications.
71. Which directory has all the commands we use, e.g., ls, cd, etc.?
● /usr/bin or /bin.
72. What is the difference between memory, virtual memory, and cache?
● Memory (RAM) is the physical hardware inside a computer that
temporarily stores data.
● Virtual memory is a memory management capability that uses disk space
as an extension of RAM.
● Cache is a smaller, faster memory component that stores copies of
frequently accessed data for quick access.
73. Correct order of interaction:
● a. User>> Operating System >> Hardware
74. Which of the following is a communication command?
● mail
75. Why is the “tail –f logfilename” command used most often and what does it do?
● It outputs all incoming logs in real-time, useful for monitoring log files as
they are updated.
76. How to sort a file in reverse order?
● Use sort -r filename.
77. List all byte sizes from smallest to largest.
● Bit, Byte, Kilobyte (KB), Megabyte (MB), Gigabyte (GB), Terabyte (TB),
Petabyte (PB), Exabyte (EB).

in/harunseker/ 200+ Linux Technical Interview Questions 7


78. How to check the total number of partitions in Linux?
● Use fdisk -l.
79. How to access a Linux system from a Linux system?
● Use ssh.
80. Explain the procedure of bonding 2 NICs or interfaces together.
● Use network bonding to combine two or more NICs into a single bonded
interface for redundancy or increased throughput. This typically involves
configuring /etc/network/interfaces or
/etc/sysconfig/network-scripts/ifcfg-bond0 and using the bonding

kernel module.
81. What is the exact command syntax to list the 5th column of a file and cut the first
3 letters?
● awk '{print $5}' filename | cut -c1-3
82. What is the /etc/hosts file used for?
● It is used to resolve hostnames to IP addresses locally.
83. List any 3 options of ‘df’ command and what they are used for.
● -h: human-readable format, -i: inodes information, -T: file system type.
84. What is swap space and how to check swap space?
● Swap space is a portion of the hard drive used as an extension of RAM.
Check swap space using swapon -s or free.
85. What is inode and how to find an inode of a file?
● An inode is a data structure on a filesystem that stores information about
a file or directory. Use ls -i filename to find the inode number.
86. Which file to edit for kernel tuning?
● Edit /etc/sysctl.conf for kernel parameter tuning.
87. What is the latest version of Redhat?
● Search online for the most recent version as it frequently updates.
88. Name the command to find a specific word from a file.
● grep word filename
89. 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?

in/harunseker/ 200+ Linux Technical Interview Questions 8


● Check system time, crontab entry syntax, and /var/log/cron for errors.
90. How to check system hardware information?
● Use dmidecode.
91. How to check network interface MAC address?
● Use ifconfig or ip link.
92. If I don’t want others to read my file1, how do I do that?
● Remove read permission for others using chmod o-r file1.
93. What is the purpose of “uniq” and “sed” commands?
● uniq removes duplicate lines from sorted input, sed is a stream editor for
filtering and transforming text.
94. 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?
● ls -ltr
95. What is the difference between tar, gzip, and gunzip?
● tar is used for archiving files, gzip compresses files, and gunzip
decompresses files.
96. What are the different ways to install an OS?
● Using a DVD, DVD ISO, or network boot.
97. How to view the difference between two files?
● Use diff file1 file2.
98. You noticed that one of the Linux servers has no disk space left, how would you
troubleshoot that issue?
● If using LVM, add more disk space and extend the logical volume. If not,
add a new disk, create a partition, and link it to an existing filesystem.
99. How to check Redhat version release?
● Use cat /etc/redhat-release or uname -a.
100. What is the difference between TCP and UDP?
● TCP is connection-oriented and reliable, while UDP is connectionless and
faster but less reliable.
101. What is a zombie process?

in/harunseker/ 200+ Linux Technical Interview Questions 9


● A zombie process is a process that has completed execution but still has
an entry in the process table, waiting for the parent process to read its exit
status.
102. How do you search for a pattern/word in a file and then replace it in an entire
file?
● Use sed for search and replace operations.
103. How to check the number of users logged in?
- Use who command.
104. What is the command to view the calendar of 2024?
cal 2024
105. Which command is used to view disk space?
df -h
106. How to create a new group in Linux?
● groupadd groupname.
107. What is the command to send a message to everyone who is logged into the
system?
● Use wall command.
108. Which command is used to check the total number of disks?
● fdisk -l.

109. What is a mail server record in DNS?


● MX (Mail Exchange) record
110. What does the following command line do? ps -ef | awk '{print $1}' |
sort | uniq
● Lists the first column of all running processes, sorts them, and removes
duplicates.
111. You get a call that when a user goes to www.yourwebsite.com it fails and gets
an error, how do you troubleshoot?
● Check user internet connectivity, DNS configuration, server status, and
web service available
112. List 4 different directories in /?
● /etc, /bin, /tmp, /home.
113. What is the output of the following command:

in/harunseker/ 200+ Linux Technical Interview Questions 10


● $ tail -10 filename | head -1

● It will show the first line from the last 10 lines of a file.
114. What are the different fields in /etc/passwd file?

The `/etc/passwd` file contains the following fields separated by colons (:):

● Username: The user's login name.


● Password: An 'x' character indicates that the password is stored in the
`/etc/shadow` file.
● UID: User ID number.
● GID: Group ID number.
● GECOS: User's full name or other information.
● Home Directory: The path to the user's home directory.
● Shell: The user's default shell.
115. Which command is used to list the processes?
● ps -ef

The `ps -ef` command is used to list all the currently running processes.
116. What is the difference between “hostname” and “uname” commands?
● hostname: Displays or sets the system's hostname.
● uname: Prints system information, such as the kernel name, version, and
other details. `uname -n` specifically prints the network node hostname,
similar to the `hostname` command.
117. How to check system load?
● You can check system load using the top and uptime commands.
118. How to schedule jobs?
● You can schedule jobs using crontab for repetitive tasks and at for
one-time tasks.
119. What is the 3rd field when setting up crontab?
● The third field in a crontab entry is the "Day of the month".
120. What is the “init #” for system reboot?
● The `init` level for system reboot is `6`.
121. How to restart a service?
● systemctl restart servicename

in/harunseker/ 200+ Linux Technical Interview Questions 11


● sudo service servicename restart

122. How to shutdown a system?**


● shutdown now
● init 0
● systemctl poweroff

123. What is the “ftp” command used for?


● The `ftp` command is used to transfer files between a local system and a
remote server using the FTP protocol.
124. Explain cron job syntax? First is minute, second is..?
● The cron job syntax consists of five fields followed by the command to be
executed:
○ 1. Minute (0-59)
○ 2. Hour (0-23)
○ 3. Day of the month (1-31)
○ 4. Month (1-12 or JAN-DEC)
○ 5. Day of the week (0-6 or SUN-SAT).
125. How to delete a package in Linux?
● rpm -e packagename

● for RPM-based systems.


126. What is the file name where user password information is saved?
● The user password information is saved in the `/etc/shadow` file.
127. Which command would you use to find the location of the chmod command?
● which chmod

128. Which command is used to check if the other computer is online?


● ping othercomputer

129. Please explain about LAN, MAN and WAN?


● LAN (Local Area Network): Covers a small geographic area like a home,
office, or building.
● MAN (Metropolitan Area Network): Spans a city or a large campus.
● WAN (Wide Area Network): Covers a large geographic area, such as a
country or continent, connecting multiple LANs.

in/harunseker/ 200+ Linux Technical Interview Questions 12


130. How to list hidden files in a directory?
● ls -la

131. What is the difference between telnet and ssh?


● SSH (Secure Shell): Provides encrypted communication and is secure.
● Telnet: Does not provide encryption and is not secure.
132. How to run a calculator on Linux and exit out of it?
● Run `bc` to start the calculator and type `quit` to exit.
133. List any 4 commands to monitor the system?
● top
● df -h
● iostat
● dmesg
134. You are notified that your server is down, list the steps you will take to
troubleshoot?
● - Check the system physically.
● - Login through the system console.
● - Ping the system.
● - Reboot or boot if possible.
135. What is the difference between static and DHCP IP?
● Static IP: Manually assigned and does not change.
● DHCP IP: Automatically assigned by a DHCP server and can change over
time.
136. How to write in vi editor mode?
● - `i` = insert
● - `a` = insert after the cursor
● - `o` = insert a new line below the current line
137. What is the difference between “crontab” and “at” jobs?
● crontab: Schedules repetitive jobs.
● at: Schedules one-time jobs.
138. What is vCenter server in VMWare?

in/harunseker/ 200+ Linux Technical Interview Questions 13


● vCenter Server is a centralized management tool for managing VMware
vSphere environments, providing control over virtual machines, ESXi hosts,
and other components.
139. What is the “dmidecode” command used for?
● The `dmidecode` command is used to retrieve system hardware
information from the DMI (Desktop Management Interface) table.
140. What is the difference between SAN and NAS?
● SAN (Storage Area Network): Provides block-level storage and is typically
used in enterprise environments.
● NAS (Network Attached Storage): Provides file-level storage and is often
used for simpler file sharing.
141. What is the location of system logs? E.g. messages
● System logs are typically located in the /var/log directory.
142. How to set up an alias and what is it used for?
● alias aliasname="command"
● It is used to create shortcuts for long commands.
143. What is the purpose of the “netstat” command?
● The `netstat` command is used to display network connections, routing
tables, interface statistics, masquerade connections, and multicast
memberships.
144. What are terminal control keys, list any 3?
○ Ctrl+C: Interrupt a process.
○ Ctrl+D: End of input (EOF).
○ Ctrl+Z: Suspend a process.
145. Which command(s) you would run if you need to find out how many
processes are running on your system?
● ps -ef | wc -l
146. How to delete a line when in vi editor mode?
● Press `dd` to delete a line.
147. How to save and quit from vi editor?

Press `Shift ZZ` or type `:wq!` and press Enter.

in/harunseker/ 200+ Linux Technical Interview Questions 14


148. What is the difference between a process and daemon?
● Process: A running instance of a program.
● Daemon: A background process that starts at boot time and runs
continuously.
149. What is the process or daemon name for NTP?
● The process or daemon name for NTP is `ntpd`.
150. What are a few commands you would run if your system is running slow?
● `top`: To view running processes and their resource usage.
● `iostat`: To monitor system input/output device loading.
● `df -h`: To check disk space usage.
● `netstat`: To display network connections and statistics.
151. How to install a package in Redhat Linux?
● yum install packagename

152. What is the difference between “ifconfig” and “ipconfig” commands?


● ifconfig: Used in Linux to configure and display network interface
parameters.
● ipconfig: Used in Windows to display all current TCP/IP network
configuration values.
153. What is the first line written in a shell script?
● The first line in a shell script is the shebang, which defines the shell to
interpret the script, e.g., `#!/bin/bash`.
154. Where is the network (Ethernet) file located, please provide the exact directory
location and file name?
● The network configuration file is located at
`/etc/sysconfig/network-scripts/ifcfg-nic`, where `nic` represents the
network interface card name (e.g., `eth0`).
155. Why do we use the “last” command?
● The `last` command is used to display a list of the last logged-in users,
showing both active and logged-off sessions.
156. What does RHEL Linux stand for?
● RHEL stands for Red Hat Enterprise Linux.

in/harunseker/ 200+ Linux Technical Interview Questions 15


157. To view your command history, which command is used and how to run a
specific command?
● Use history to view the command history.
● To run a specific command, use !n, where `n` is the command number
from the history list.
158. What is NTP and briefly explain how it works and where are the config files
and related commands of NTP?
● NTP (Network Time Protocol): Used to synchronize the clocks of
computers over a network.
● How it works: NTP servers provide time information to clients, which
adjust their clocks accordingly.
● Config files: Located at `/etc/ntp.conf`.
● Related commands**: `ntpd` for the daemon, `ntpq` for querying NTP
servers.
159. How to disable the firewall in Linux?
● To disable the firewall, you can use:
● systemctl stop firewalld
● systemctl disable firewalld
160. How to configure mail server relay for sendmail service?
● Edit the `/etc/mail/sendmail.mc` file and add the `SMART_HOST` entry to
specify the relay host.
161. Where is the samba log file located?
● The Samba log file is located at var/log/samba.
162. What is the `mkfs` command used for?**
● The `mkfs` command is used to create a new filesystem on a device.
163. If you create a new group, which file does it get created in?
● The new group information is stored in the `/etc/group` file.
164. Which file has DNS server information (e.g., DNS resolution)?
● DNS server information is stored in the `/etc/resolv.conf` file.
165. What are the commands you would run if you need to find out the version and
build date of a package (e.g., http)?

in/harunseker/ 200+ Linux Technical Interview Questions 16


● rpm -qi http

166. On the file permissions, what are the first 3 bits for and who is it for?
● The first three bits represent the permissions for the file owner: read (r),
write (w), and execute (x).
167. How to create a soft link?
● ln -s target linkname
168. How to write a script to delete messages in a log file older than 30 days
automatically?
● You can use the `find` command in a script:
● find /path/to/logs -type f -mtime +30 -exec rm {} \;
169. How to quit out of the “man” command?
● Press q to quit the manual page viewer.
170. Which command is used to partition a disk in Linux?
● The fdisk command is used to partition a disk.
171. What is the difference between the “shutdown” and “halt” command?
● shutdown: Gracefully shutdown the system, allowing processes to
terminate properly.
● halt: Stops all processes and halts the system without powering it off.

172. What is the exact syntax of mounting an NFS share on a client and also how
to un-mount?**
● Mount: `mount -t nfs server:/path/to/share /mount/point`
● Unmount: `umount /mount/point`
173. What experience do you have with scripting, explain?
● Experience with scripting includes using control structures like `if-then`,
`do-while`, `case`, and `for` loops to automate tasks.
174. How to get information on all the packages installed on the system?
● rpm -qa

175. Explain VMWare?**


● VMWare is a company that provides cloud computing and virtualization
technology, including products like vSphere, ESXi, and vCenter.

in/harunseker/ 200+ Linux Technical Interview Questions 17


176. You are tasked to examine a log file in order to find out why a particular
application keeps crashing. The log file is very lengthy, which command can you
use to simplify the log search using a search string?
● Use the `grep` command to search for specific strings like "error",
"warning", or "failure" in the log file:
● grep "error" /var/log/messages
177. What is an /etc/fstab file and explain each column of this file?
● The `/etc/fstab` file contains information about filesystems and their
mount points. Each line has six fields:
● 1. **Device**: The block device or remote filesystem.
● 2. **Mount Point**: Directory where the filesystem is mounted.
● 3. **Filesystem Type**: Type of filesystem (e.g., ext4, nfs).
● 4. **Options**: Mount options (e.g., defaults, ro).
● 5. **Dump**: Backup utility flag (0 or 1).
● 6. **Pass**: Filesystem check order at boot (0, 1, or 2).
178. What is the latest version of Windows server?
● The latest version as of 2023 is Windows Server 2022.
179. What is the exact command to list only the first 2 lines of history output?
● history | head -2

180. How to upgrade Linux from 7.3 to 7.4?


● yum update: This command updates all packages to their latest versions,

including upgrading the distribution version.


181. How to tell which shell you are in or running?
● echo $0

182. 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?
● You need execute (`x`) permission on the directory to change into it.
183. What is CNAME record in DNS?
● A CNAME (Canonical Name) record is a type of DNS record that maps an
alias name to a true or canonical domain name.
184. What is the name of the VMWare operating system?**
● The VMWare operating system is called ESXi.

in/harunseker/ 200+ Linux Technical Interview Questions 18


185. What is the client name used to connect to ESXi or vCenter server?
● The client used to connect to ESXi or vCenter is the vSphere Client.
186. 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?
● Check the file permissions and ensure the user has write (`w`) permission.
187. What is the latest version of VMWare?
● As of 2023, the latest version of VMware vSphere is 8.0.
188. What is the name of the firewall daemon in Linux?
● The firewall daemon in Linux is called `firewalld`.
189. Which command syntax can you use to list only the 20th line of a file?
● sed -n '20p' filename

190. What is the difference between run level 3 and 5?


● Run level 3: Multi-user mode with networking, but without a graphical
interface.
● Run level 5: Multi-user mode with networking and a graphical interface
(GUI).
191. What is the difference between domain and nameserver?
● Domain: A domain is a human-readable address used to access resources on
the internet.
● Nameserver: A server that translates domain names into IP addresses.
192. You open up a file and it has 3000 lines and it scrolls up really fast, which
command will you use to view it one page at a time?
● Use `less` or `more` to view the file one page at a time.
193. How to start a new shell. E.g., start a new ksh shell?
● Simply type `ksh` or `bash` to start a new shell session.
194. How to kill a process?
● kill processID

195. How to check scheduled jobs?


● crontab -l

196. How to check system memory and CPU usage?


● Memory: Use `free`.
● CPU Usage: Use `top` or `htop`.

in/harunseker/ 200+ Linux Technical Interview Questions 19


197. Which utility could you use to repair the corrupted file system?**
● Use the `fsck` (File System Consistency Check) utility.
198. What is the command to make a service start at boot?**
● systemctl enable servicename

199. Which file to modify to allow users to run root commands?**


● Modify the `/etc/sudoers` file, typically using `visudo` for safe editing.
200. You need to modify the httpd.conf file but you cannot find it. Which command
line tool can you use to find the file?**
● find / -name "httpd.conf"

201. Your system crashed and is 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` partition or bootloader is most likely corrupted or missing.
202. What are the most essential [90+] Linux Commands you NEED to know

No Command Description Example

File and Directory Management

Prints the current working pwd displays the full path of the current
1 pwd
directory. directory.

ls -l lists files in long format, showing


permissions, owner, size, and modification
date.

2 ls Lists directory contents. ls -a lists files including hidden files (those


starting with a dot)

ls -la list directory contents in a long


format, including hidden files.

in/harunseker/ 200+ Linux Technical Interview Questions 20


Changes the current cd /home/user changes the directory to
3 cd
directory. /home/user.

mkdir newdir creates a directory named


4 mkdir Creates a new directory.
newdir.

Removes an empty rmdir olddir removes the empty directory


5 rmdir
directory. olddir.

Creates an empty file or


touch newfile.txt creates an empty file
6 touch updates the timestamp of
named newfile.txt.
an existing file.

echo "Hello, World!"


prints Hello, World! to the terminal.

echo "Hello, World!" >


filename.txt
creates a new text file named "filename.txt" (or
Displays a line of text or a overwrites it if it already exists) and writes the
7 echo
variable value. phrase "Hello, World!" into it.

echo "Hello, World!" >>


filename.txt
appends the phrase "Hello, World!" to the end
of the existing file named "filename.txt" (or
creates the file if it doesn't exist).

cp file1.txt file2.txt copies file1.txt


to file2.txt.
8 cp Copies files or directories. cp file1.txt ./Desktop copies the file
named "file1.txt" from the current directory to
the Desktop folder.

used for moving and mv oldname.txt newname.txt renames


9 mv renaming files and oldname.txt to newname.txt in the current
directories. directory.

in/harunseker/ 200+ Linux Technical Interview Questions 21


mv file1.txt ./Desktop moves the file
named "file1.txt" from the current directory to
the Desktop folder.

Removes files or
10 rm rm file.txt deletes file.txt.
directories.

File Viewing and Editing

Concatenates and displays


11 cat cat file.txt displays the content of file.txt.
file content.

Views file content one less file.txt displays file.txt content one
12 less
screen at a time. screen at a time.

displays the content of


13 more the file one screen at a more file.txt
time.

nano file.txt opens file.txt in the Nano


14 nano Open the Nano text editor.
editor.

vim file.txt opens file.txt in the Vim


15 vim Open the Vim text editor.
editor.

Displays the first part of a head -n 10 file.txt shows the first 10


16 head
file. lines of file.txt.

Displays the last part of a tail -n 10 file.txt shows the last 10


17 tail
file. lines of file.txt.

Compare two files byte by cmp file1 file2 compares file1 and
18 cmp
byte. file2.

in/harunseker/ 200+ Linux Technical Interview Questions 22


diff file1 file2 shows the differences
19 diff Compares files line by line.
between file1 and file2.

20 sort Sorts lines of text files. sort file.txt sorts the lines in file.txt.

Searches for files in a find /home -name "*.txt" finds all


21 find
directory hierarchy. .txt files in the /home directory.

chmod 755 script.sh sets the


22 chmod Changes file permissions.
permissions of script.sh to rwxr-xr-x.

chown user:group file.txt changes


Changes file owner and
23 chown the owner and group of file.txt to user
group.
and group.

Searches for patterns in grep "pattern" file.txt searches for


24 grep
files. "pattern" in file.txt.

A programming language
awk '{print $1}' file.txt prints the
25 awk for pattern scanning and
first field of each line in file.txt.
processing.

Process Management

Displays information about ps aux shows detailed information about all


26 ps
active processes. running processes.

Displays real-time system top shows real-time processes and system


27 top
resource usage. resource usage.

An interactive process htop provides an interactive view of system


28 htop
viewer. processes.

in/harunseker/ 200+ Linux Technical Interview Questions 23


Terminates a process by kill 1234 terminates the process with PID
29 kill
PID. 1234.

Terminates processes by killall firefox terminates all processes


30 killall
name. named firefox.

Displays running processes pstree shows the process hierarchy, with


31 pstree
as a tree child processes indented under their parents.

Terminates processes by pkill firefox terminates all processes


32 pkill
name or other attributes. named firefox.

System Information

33 uname Prints system information. uname -a displays all system information.

Displays system
neofetch shows system information in a
34 neofetch information with an
visually appealing format.
aesthetic layout.

Displays disk space usage df -h shows disk space usage in a


35 df
of file systems. human-readable format.

du -sh /path/to/directory shows the


Estimates file and directory
36 du total size of a directory in human-readable
space usage.
format.

free -h shows memory usage in a


37 free Displays memory usage.
human-readable format.

Displays information about


38 lscpu lscpu
the CPU architecture.

39 lshw Lists hardware information. sudo lshw

in/harunseker/ 200+ Linux Technical Interview Questions 24


Lists information about
40 lsblk lsblk
block devices.

User and Group Management

Displays the current whoami shows the username of the current


41 whoami
logged-in user. user.

Executes a command as
sudo apt-get update runs the apt-get
42 sudo another user, typically the
update command with superuser privileges.
superuser.

Switch to another user


43 su su - user switches to the user account.
account.

sudo useradd newuser adds a new user


44 useradd Adds a new user.
named newuser.

Adds a new user with a sudo adduser newuser interactively adds


45 adduser
more interactive interface. a new user named newuser.

Changes a user's passwd prompts to change the current user's


46 passwd
password. password.

sudo userdel username removes the


47 userdel Deletes a user account.
specified user account.

Modifies user account sudo usermod -aG sudo username


48 usermod
properties. adds the user to the sudo group.

sudo groupadd newgroup creates a new


49 groupadd Creates a new group.
group named newgroup.

sudo groupdel groupname removes the


50 groupdel Deletes a group
specified group.

in/harunseker/ 200+ Linux Technical Interview Questions 25


Displays group groups username shows all groups the
51 groups
membership for a user. specified user belongs to.

Displays user and group


id username shows user ID, group ID, and
52 id information for a specified
group memberships for the specified user.
user.

Network Configuration and Monitoring

Display network interface


ifconfig eth0 displays the configuration of
53 ifconfig information. Configures
the eth0 interface.
network interfaces.

ip Displays IP addresses and ip address show shows all IP addresses


54
address interfaces. and network interfaces.

Sends ICMP
ping google.com sends ping requests to
55 ping ECHO_REQUEST packets to
google.com.
network hosts.

Displays network
netstat -tuln shows listening ports and
56 netstat connections, routing tables,
their status.
and interface statistics.

ss -tuln shows listening sockets.


57 ss Displays socket statistics. ss -l4p displays all listening IPv4 sockets
along with the associated processes

tracerout Traces the route packets traceroute google.com shows the route
58
e take to a network host. to google.com.

Connects to a remote ssh user@hostname connects to the remote


59 ssh
machine via SSH. machine hostname as user.

nc -l 1234 listens on port 1234.


A versatile networking
60 nc nc hostname 80 connects to 'hostname' on
utility for reading from and
port 80.

in/harunseker/ 200+ Linux Technical Interview Questions 26


writing to network
connections.

Package Management

sudo apt install package installs the


specified package.

sudo apt remove package removes the


specified package.
Manages packages on
61 apt apt update update the package list
Debian-based systems.
apt upgrade upgrade installed packages to
their latest versions

apt dist-upgrade perform a


comprehensive system upgrade

sudo apt-get install package installs


An older command-line tool the specified package.
62 apt-get for package management
on Debian-based systems. sudo apt-get remove package removes
the specified package.

Package manager for sudo yum install package installs the


RPM-based Linux specified package.
63 yum
distributions (e.g., CentOS, sudo yum remove package removes the
RHEL). specified package.

Next-generation package sudo dnf install package installs the


manager for RPM-based specified package.
64 dnf
distributions (successor to sudo dnf remove package removes the
yum). specified package.

rpm -i package.rpm installs an RPM


Low-level package package.
65 rpm manager for RPM-based
systems. rpm -e package removes an installed
RPM package.

in/harunseker/ 200+ Linux Technical Interview Questions 27


sudo dpkg -i package.deb installs a
Low-level package Debian package.
66 dpkg manager for Debian-based
systems. sudo dpkg -r package removes an
installed Debian package

sudo snap install package installs a


Universal Linux package snap package.
67 snap manager for containerized
applications. sudo snap remove package removes a
snap package.

sudo zypper install package installs


Package manager for the specified package.
68 zypper openSUSE and SUSE Linux
Enterprise. sudo zypper remove package removes
the specified package.

Other Commands

ln -s target linkname creates a


Creates hard and symbolic
69 ln symbolic link named linkname pointing to
links.
target.

70 clear Clears the terminal screen. clear clears the terminal display.

Exits the current shell or


71 exit exit logs out of the current session.
session.

Displays information about


72 finger finger user shows details about user.
system users.

Displays the manual page man ls shows the manual for the ls
73 man
for a command. command.

Displays a brief description whatis ls provides a short description of the


74 whatis
of a command. ls command.

in/harunseker/ 200+ Linux Technical Interview Questions 28


curl -O
Transfers data from or to a
75 curl http://example.com/file.txt
server.
downloads file.txt from the specified URL.

Compresses files into a zip zip archive.zip file1 file2


76 zip
archive. compresses file1 and file2 into archive.zip.

Extracts files from a zip unzip archive.zip extracts files from


77 unzip
archive. archive.zip.

resolvect Shows the current DNS resolvectl status displays the DNS
78
l status settings. configuration and status.

Configures packet filtering sudo iptables -L lists all current iptables


79 iptables
rules. rules.

Manages firewall with


80 ufw sudo ufw enable enables the firewall.
Uncomplicated Firewall.

81 cal Displays a calendar. cal shows the current month's calendar.

Manages systemd systemctl status nginx shows the


82 systemctl
services. status of the nginx service.

Displays the command history shows the list of previously executed


83 history
history. commands.

dig example.com retrieves DNS information


84 dig Queries DNS servers.
for example.com.

host example.com shows the IP address of


85 host Performs DNS lookups.
example.com.

in/harunseker/ 200+ Linux Technical Interview Questions 29


Displays and modifies the
86 arp arp -a shows the current ARP table.
ARP table.

Configures wireless iwconfig wlan0 shows the configuration of


87 iwconfig
network interfaces. the wlan0 wireless interface.

Displays or sets the


88 hostname hostname shows the current hostname.
system's hostname.

Queries the WHOIS


whois example.com retrieves WHOIS
89 whois database for domain
information for example.com.
information.

90 reboot Reboots the system. sudo reboot restarts the system.

Shuts down or reboots the sudo shutdown -h now shuts down the
91 shutdown
system. system immediately.

in/harunseker/ 200+ Linux Technical Interview Questions 30

You might also like