Prep - 200+ Technical Questions
Prep - 200+ Technical Questions
● 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 #.
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.
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?
● 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 (:):
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
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
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.
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
Prints the current working pwd displays the full path of the current
1 pwd
directory. directory.
Removes files or
10 rm rm file.txt deletes file.txt.
directories.
Views file content one less file.txt displays file.txt content one
12 less
screen at a time. screen at a time.
Compare two files byte by cmp file1 file2 compares file1 and
18 cmp
byte. file2.
20 sort Sorts lines of text files. sort file.txt sorts the lines 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
System Information
Displays system
neofetch shows system information in a
34 neofetch information with an
visually appealing format.
aesthetic layout.
Executes a command as
sudo apt-get update runs the apt-get
42 sudo another user, typically the
update command with superuser privileges.
superuser.
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.
tracerout Traces the route packets traceroute google.com shows the route
58
e take to a network host. to google.com.
Package Management
Other Commands
70 clear Clears the terminal screen. clear clears the terminal display.
Displays the manual page man ls shows the manual for the ls
73 man
for a command. command.
resolvect Shows the current DNS resolvectl status displays the DNS
78
l status settings. configuration and status.
Shuts down or reboots the sudo shutdown -h now shuts down the
91 shutdown
system. system immediately.