Advanced Linux Interview Questions & Answers
Advanced Linux Interview Questions & Answers
o Answer: Hard links point directly to the inode of a file, while soft links
(or symbolic links) are separate files that contain the path to the target
file.
3. How do you find all files modified in the last 10 minutes in a directory
and its subdirectories?
o Answer: The kernel is the core of the operating system that manages
hardware resources and provides essential services for other parts of
the system.
5. Explain the purpose of the 'chmod' command.
6. How can you find out the current runlevel of a Linux system?
o Answer: 'grep' is used for searching text patterns in files. It can search
for patterns using regular expressions and display matching lines.
o Answer: 'tar' is used for creating and extracting archive files. It bundles
multiple files into a single archive file and can compress the archive
using various algorithms.
13. How can you check the connectivity between two hosts using the 'ping'
command?
19. How can you check the available disk space on a specific filesystem using
the 'du' command?
o Answer: 'dd' is used for copying and converting files and can be used
for tasks like creating disk images or cloning drives.
o Answer: Use the ps command with the --sort option: ps aux --sort=-
%mem | head -n 6.
26. What is a symbolic link, and how do you create one using the 'ln'
command?
o Answer: Append & to the command, e.g., command &. Alternatively, use
the nohup command to keep a command running after logging out.
29. What is the 'sudo' command, and how is it used in Linux?
33. How can you compress and decompress files using the 'gzip' command?
o Answer: 'uptime' displays how long the system has been running, the
number of users, and the system load averages.
40. How do you monitor system resource usage using the 'top' command?
o Answer: Run the top command. Press 'q' to exit. 'top' shows real-time
information about processes and resource usage.
44. How do you check the status of a service using the 'systemctl' command?
46. How can you monitor disk I/O in real-time using the 'iotop' command?
o Answer: Install 'iotop' if not installed (sudo apt-get install iotop) and
then run sudo iotop.
48. How do you find and kill a process using its process ID (PID)?
o Answer: Use the ps command to find the PID and then kill PID to
terminate the process.
o Answer: Use the 'mount' command with the '-t tmpfs' option: sudo
mount -t tmpfs -o size=512M tmpfs /mnt/ramdisk . Adjust size and mount
point as needed.