Linux Interview Questions:
- What is Linux, and what are its main features?
- Linux is an open-source operating system modeled on UNIX. Its main features include multitasking, multi-user capabilities, portability, security, and a rich set of utilities and applications.
- What are the different Linux distributions?
- Popular Linux distributions include Ubuntu, CentOS, Debian, Fedora, Red Hat Enterprise Linux (RHEL), and Arch Linux, each tailored for specific use cases and user preferences.
- How do you check the Linux kernel version?
- You can check the Linux kernel version using the command
uname -rorcat /proc/version.
- You can check the Linux kernel version using the command
- What is the purpose of the
lscommand?- The
lscommand lists files and directories in the current directory. Options can be added to modify its output, such asls -lfor a detailed view.
- The
- What is the difference between a hard link and a soft link in Linux?
- A hard link points directly to the inode of a file, making it indistinguishable from the original. A soft link (or symbolic link) is a pointer to the filename, which can break if the original file is deleted.
- How do you change file permissions in Linux?
- You can change file permissions using the
chmodcommand, specifying the permission type (read, write, execute) and the user category (owner, group, others).
- You can change file permissions using the
- What is the Linux file system hierarchy?
- The Linux file system hierarchy is organized into a tree structure with directories like
/,/home,/etc,/var,/usr, and/bin, each serving a specific purpose.
- The Linux file system hierarchy is organized into a tree structure with directories like
- How do you view running processes in Linux?
- You can view running processes using the
pscommand (e.g.,ps aux) or thetopcommand for a dynamic view of processes.
- You can view running processes using the
- What is the purpose of the
grepcommand?- The
grepcommand searches for specific patterns within files or output, allowing users to filter and find relevant information quickly.
- The
- How do you create a new user in Linux?
- You can create a new user using the
useraddcommand, followed by the username, and set a password with thepasswdcommand.
- You can create a new user using the
Intermediate Level:
- What is the purpose of the
/etc/passwdfile?- The
/etc/passwdfile stores user account information, including username, user ID (UID), group ID (GID), home directory, and shell.
- The
- How do you search for files in Linux?
- You can search for files using the
findcommand (e.g.,find /path/to/search -name "filename") or thelocatecommand for quicker results if the database is updated.
- You can search for files using the
- What is a process, and how is it different from a thread?
- A process is an instance of a running program, while a thread is a smaller unit of a process that can run concurrently, sharing the same resources.
- How do you schedule tasks in Linux?
- You can schedule tasks using the
crondaemon, defining time-based jobs in the crontab file with thecrontab -ecommand.
- You can schedule tasks using the
- What is the purpose of the
chmodcommand?- The
chmodcommand changes the file mode (permissions) of a file or directory, controlling read, write, and execute access for users.
- The
- How do you find the disk usage in Linux?
- You can find disk usage using the
ducommand (e.g.,du -sh *) to summarize the size of files and directories.
- You can find disk usage using the
- What is the
sudocommand, and how is it used?- The
sudocommand allows users to execute commands with superuser privileges, enabling them to perform administrative tasks without logging in as the root user.
- The
- How can you view system logs in Linux?
- System logs can be viewed using the
tailcommand on log files in the/var/logdirectory (e.g.,tail -f /var/log/syslog).
- System logs can be viewed using the
- What is the difference between the
aptandyumpackage managers?aptis used in Debian-based systems (like Ubuntu) for package management, whileyumis used in Red Hat-based systems (like CentOS) for managing packages.
- What is a shell in Linux?
- A shell is a command-line interface that allows users to interact with the operating system by executing commands and scripts. Common shells include Bash, Zsh, and Sh.
Advanced Level:
- What is a daemon in Linux?
- A daemon is a background process that runs independently of user control, often providing services like logging, printing, or web serving.
- How do you monitor system performance in Linux?
- You can monitor system performance using tools like
top,htop,vmstat,iostat, andsarto analyze CPU, memory, and disk usage.
- You can monitor system performance using tools like
- What is the purpose of the
rsynccommand?- The
rsynccommand is used for synchronizing files and directories between local and remote systems, providing options for compression and delta transfers.
- The
- How can you check network connectivity in Linux?
- You can check network connectivity using commands like
ping,traceroute, andnetstatto diagnose network issues.
- You can check network connectivity using commands like
- What is the difference between TCP and UDP?
- TCP (Transmission Control Protocol) is a connection-oriented protocol that ensures reliable data transfer, while UDP (User Datagram Protocol) is a connectionless protocol that allows faster data transmission without guaranteed delivery.
- How do you set environment variables in Linux?
- Environment variables can be set using the
exportcommand (e.g.,export VARIABLE_NAME=value), and can be made persistent by adding them to configuration files like.bashrcor.profile.
- Environment variables can be set using the
- What is a swap space in Linux?
- Swap space is a portion of the hard disk used as virtual memory when RAM is full, allowing the system to continue functioning by moving inactive pages from memory to disk.
- How can you manage services in Linux?
- Services can be managed using commands like
systemctlfor systems with systemd (e.g.,systemctl start/stop/restart service_name) orservicefor older init systems.
- Services can be managed using commands like
- What is the purpose of the
tarcommand?- The
tarcommand is used for creating and extracting compressed archive files, commonly used for backups and file transfers.
- The
- How do you secure a Linux server?
- You can secure a Linux server by implementing firewalls (e.g.,
iptables,ufw), regularly updating software, configuring SSH settings, using strong passwords, and enabling SELinux.
- You can secure a Linux server by implementing firewalls (e.g.,

The founder of TacoBIG.com.He is a Cloud Architect from Bangalore interested in contributing guidance to Cloud related communities. He loves to read books and share knowledge with others. He is keen on understanding Financial wisdom and sharing thoughts on how to achieve financial freedom.


