Introduction

Linux is an open-source Unix-like operating system-based family on the Linux kernel, and the OS kernel was first published on 17 September 1991 by Linus Torvalds. Typically, Linux is packaged as the Linux distribution, which contains the supporting libraries and system software and kernel, several of which are offered by the GNU Project. Several Linux distributions use the term “Linux” in the title, but the Free Software Foundation uses the “GNU/Linux” title to focus on the necessity of GNU software, causing a few controversies.

Famous Linux distributions are Ubuntu, Fedora Linux, and Debian, the latter of which is composed of several different modifications and distributions, including Xubuntu and Lubuntu. Commercial distributions are SUSE Linux Enterprise and Red Hat Enterprise Linux. Desktop distributions of Linux are windowing systems like Wayland or X11 and desktop environments like KDE Plasma and GNOME.

Explore a comprehensive collection of Linux Networking Interview Questions & Answers to enhance your understanding of key concepts. From TCP/IP fundamentals to network configuration and troubleshooting, this resource covers a wide range of topics essential for mastering Linux networking. Whether you’re a seasoned professional or preparing for an interview, delve into this guide to strengthen your knowledge and ensure success in Linux networking discussions. Gain insights into network protocols, routing, security, and more, as you navigate through detailed answers crafted to deepen your expertise in Linux networking.

Linux Networking Interview Questions

1. What is the iptables command in Linux ?

iptables command blocks or allows traffic on a Linux host, similar to a network firewall. This iptables command may prevent certain applications from receiving or transmitting requests.

2. What is the difference between Linux and Windows ?

Linux Windows
Linux is available for FREE It is paid software
It is an Open-Source operating system It is not an open-source OS
Linux customization is possible No customizations are available
It provides high-level security Can’t defend virus and malware attacks unless until it is paid
Primary partitioning and logical partitioning available to boot Booting available while primary partitioning only
BackSlash separates directories The forward slash separates directories
File names are case particular Irrespective of the case while naming files

3. What does the cd – command do ?

cd- command go to the previous directory.

4. What is df -i command ?

df -I command shows free inodes on mounted filesystems.

5. What does (cd dir && command) do ?

cd dir && command go to the dir, executes the command and returns to the current directory.

6. What does pushd command do ?

pushd command put current dir on the stack so you can pop back to it.

7. Why is Linux considered more secure than other operating systems ?

Linux is an open-source operating system, nowadays it is rapidly growing in the technology market. We have a few reasons why Linux is more secure than other OS.

  • The perk of accounts: Linux allows only a few users to access the system. Thus, the virus cannot attack the whole system, it may cause only a few files in the system.
  • Strong Community: Linux users first accomplished the files before they open. So they can save their systems from vulnerabilities.
  • Iptables: Iptables are used by the Linux because it checks the security circle of the system.
  • Different Working Environment: Linux system has different working environments like Linux Mint, Debian, Arch, and many more, these working environments protect from the virus.
  • Recording in Linux: It maintains log history because later it can view the details of the system files easily.
  • Few User: Linux users are less compared to others, due to this security will be more.

8. What is du -s * | sort -k1,1rn | head command used for ?

This command shows top disk users in the current dir.

9. What does this du -hs /home/* | sort -k1,1h command do ?

This command sort path by easy to interpret disk usage.

10. What is df -h command ?

This command shows free space on mounted file systems.

11. What is fdisk -l command used for ?

fdisk -I command show disks partitions sizes and types (run as root).

12. How do you kill the program using one port in Linux ?

Use this command to kills the program using one port: sudo fuser -k 8000/tcp

13. How do you limit memory usage for commands ?

•	ulimit -Sv 1000       # 1000 KBs = 1 MB
•	ulimit -Sv unlimited  # Remove limit

14. How do you get the full path of a file in Linux ?

Use this command: readlink -f file.txt

15. How do you list the contents of tar.gz and extract only one file ?

Use these commands:

•	tar tf file.tgz
•	tar xf file.tgz filename

16. How do you find who is logged in ?

Use this command to find who logged in: w

17. How do you check the permissions of each directory to a file ?

It is useful to detect permissions errors, for example when configuring a web server.

namei -l /path/to/file.txt

18. How do you run the command every time a file is modified ?

Use this command to do:

while inotifywait -e close_write document.tex
do
make
done

19. How to copy text to the clipboard ?

Use this command: cat file.txt | xclip -selection clipboard

20. How do you check resources usage ?

Use this command to check resource usage: /usr/bin/time -v ls

21. How do you run a command for a limited time ?

Use this command: timeout 10s ./script.sh

# Restart every 30 minutes
while true; do timeout 30m ./script.sh; done

22. How do you combine two lines from two sorted files in Linux ?

Use this command: comm file1 file2.

23. What is meant by PIPE in Linux ?

It is a form of redirection that is used in Linux, it is used to combine more than two commands and the output of one command can take as input to the next command.

Syntax:

command_1 | command_2 | command_3 | .... | command_N

24. Describe how a parent and child process communicates with each other ?

The parent process communicates with the child process by using pipes, sockets, messages queues, and more.

25. What is a Stateless Linux Server ?

It is a centralized server that does not have any exists states on the working station. It may have scenarios when a state of a particular system takes a snapshot then, the user wants all other machines to be in that particular state.

26 Explain the features of Stateless Linux Server ?

Features of Stateless Linux Server

  1. Stores the prototype of every system.
  2. Stores the snapshot was taken.
  3. Stores the home directories.
  4. Uses LDAP, which contains the information about which snapshot should run on which system.

27. What is Zombie Process ?

It is a process whose execution is completed but even the information exists in the process table. It occurs for the child process because the parent process needs to read the child process status. Once it is completed using the wait system call, then the zombie process is removed from the process table. This is known as Zombie Process.

28. Explain the work of the Ctrl+Alt+Del key combination on the Linux operating system ?

In Linux, the Ctrl+Alt+Del key is used to restart the computer, and it does not display any confirmation message before rebooting the system.