Interview Questions

Get ready for your next interview with our comprehensive question library

Linux Administration Interview Questions

Filter by Difficulty

1.

What is the Linux file system hierarchy and what are the main directories?

beginner

The Linux file system follows the Filesystem Hierarchy Standard (FHS). Key directories include:

  • / - Root directory, the top-level directory
  • /bin - Essential user binaries (commands)
  • /boot - Boot loader files and kernel
  • /dev - Device files
  • /etc - System configuration files
  • /home - User home directories
  • /lib - Essential shared libraries
  • /media - Mount points for removable media
  • /mnt - Temporary mount points
  • /opt - Optional software packages
  • /proc - Virtual filesystem with process information
  • /root - Root user's home directory
  • /run - Runtime data
  • /sbin - System administration binaries
  • /tmp - Temporary files
  • /usr - User programs and data
  • /var - Variable data (logs, databases, etc.)
2.

Explain Linux file permissions and how to change them.

beginner

Linux uses a three-tier permission system:

  • Owner (u): The file owner
  • Group (g): The file's group
  • Others (o): All other users
    Each tier has three permissions:
  • Read (r): Permission to read the file (4)
  • Write (w): Permission to modify the file (2)
  • Execute (x): Permission to execute the file (1)
    Example: rwxr-xr-- means owner has read/write/execute, group has read/execute, others have read only.
# Change permissions using chmod
chmod 755 file.txt        # rwxr-xr-x
chmod u+x script.sh       # Add execute for owner
chmod g-w file.txt        # Remove write for group
chmod o=r file.txt        # Set others to read only
# Change ownership
chown user:group file.txt
chgrp newgroup file.txt
3.

How do you find files and directories in Linux?

beginner

Multiple commands are available for finding files:
find command (most powerful):

# Find by name
find /path -name "filename"
find . -name "*.txt"
# Find by type
find /home -type f        # Files only
find /home -type d        # Directories only
# Find by size
find /var -size +100M     # Files larger than 100MB
find . -size -1k          # Files smaller than 1KB
# Find by permissions
find . -perm 755
find . -perm -u+x         # Files executable by owner
# Find and execute action
find /tmp -name "*.tmp" -delete
find . -name "*.log" -exec rm {} \;

locate command (faster, uses database):

locate filename
updatedb              # Update locate database

which/whereis commands:

which python           # Find executable in PATH
whereis python         # Find binary, source, manual
4.

How do you view and manage running processes?

beginner

Several commands help manage processes:

# View processes
ps aux                  # All processes with details
ps -ef                  # Full format listing
ps -u username          # Processes for specific user
pstree                  # Process tree view
# Real-time process monitoring
top                     # Interactive process viewer
htop                    # Enhanced version of top
atop                    # Advanced system monitor
# Process information
jobs                    # Current shell jobs
pgrep process_name      # Find process IDs by name
pidof process_name      # Get PID of running process

Process states:

  • R: Running
  • S: Sleeping (waiting)
  • D: Uninterruptible sleep
  • Z: Zombie
  • T: Stopped
5.

How do you kill processes in Linux?

beginner
# Kill by PID
kill PID                # Send TERM signal (15)
kill -9 PID             # Send KILL signal (forceful)
kill -15 PID            # Send TERM signal (graceful)
# Kill by name
killall process_name    # Kill all processes with name
pkill pattern           # Kill processes matching pattern
# Common signals
kill -l                 # List all signals
kill -HUP PID          # Reload configuration (1)
kill -INT PID          # Interrupt (2)
kill -QUIT PID         # Quit (3)
kill -KILL PID         # Force kill (9)
kill -TERM PID         # Terminate (15)
kill -STOP PID         # Stop process (19)
kill -CONT PID         # Continue process (18)
6.

What are background and foreground processes?

beginner

Foreground processes: Run in the terminal and accept input
Background processes: Run independently without blocking terminal

# Run command in background
command &               # Start in background
nohup command &         # Continue after logout
# Job control
jobs                    # List current jobs
fg %1                   # Bring job 1 to foreground
bg %1                   # Send job 1 to background
Ctrl+Z                  # Suspend current process
Ctrl+C                  # Terminate current process
# Detach from terminal
nohup long_command > output.log 2>&1 &
disown %1               # Remove job from shell
7.

How do you manage users and groups in Linux?

beginner
# User management
useradd username         # Add new user
useradd -m -s /bin/bash username  # Create with home directory
userdel username         # Delete user
userdel -r username      # Delete user and home directory
usermod -aG groupname username    # Add user to group
passwd username          # Change user password
chage -l username        # View password aging info
# Group management
groupadd groupname       # Create new group
groupdel groupname       # Delete group
gpasswd -a username groupname     # Add user to group
gpasswd -d username groupname     # Remove user from group
# View user/group information
id username              # Show user ID and groups
groups username          # Show user's groups
getent passwd username   # Get user info from database
getent group groupname   # Get group info
8.

What are the important user configuration files?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
9.

How do package managers work in different Linux distributions?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
10.

How do you manage system logs in Linux?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
11.

How do you monitor disk usage and performance?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
12.

How do you schedule tasks with cron?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
13.

What are special permissions (SUID, SGID, Sticky bit)?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
14.

What are hard links and soft links (symbolic links)?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
15.

What are daemons and how do you create one?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
16.

Explain process priorities and nice values.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
17.

How do you implement sudo access?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
18.

How do you compile and install software from source?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
19.

What are repositories and how do you manage them?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
20.

How do you configure network interfaces in Linux?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
Showing 1 to 20 of 52 results

Premium Plan

$10.00 /monthly
  • Access all premium content - interview questions, and other learning resources

  • We regularly update our features and content, to ensure you get the most relevant and updated premium content.

  • 1000 monthly credits

  • Cancel anytime