As modern IT infrastructure increasingly relies on Linux-based systems, recruiters must identify Linux Administrators who can ensure system stability, security, and performance. From managing user access and permissions to configuring servers and automating tasks, Linux Admins play a critical role in maintaining enterprise environments.
This resource, "100+ Linux Admin Interview Questions and Answers," is tailored for recruiters to simplify the evaluation process. It covers everything from basic command-line operations to advanced system administration, including shell scripting, cron jobs, network configuration, and security hardening.
Whether hiring System Administrators, DevOps Engineers, or Infrastructure Specialists, this guide enables you to assess a candidate’s:
For a streamlined assessment process, consider platforms like WeCP, which allow you to:
✅ Create customized Linux Admin assessments for various distributions like Ubuntu, CentOS, or RHEL.
✅ Include hands-on terminal-based tasks and scripting exercises.
✅ Proctor exams remotely with integrity safeguards.
✅ Use AI-powered analysis to auto-evaluate scripts, commands, and config scenarios.
Save time, boost hiring quality, and confidently recruit Linux Administrators who can keep your systems secure, stable, and production-ready from day one.
Linux is an open-source, Unix-like operating system (OS) that serves as the foundation for a wide range of devices, from servers and desktops to mobile phones and embedded systems. It was originally created by Linus Torvalds in 1991, and its source code is freely available to anyone, making it a key player in the world of open-source software. Unlike proprietary operating systems like Windows or macOS, Linux is built on a philosophy of collaboration, allowing developers to modify and distribute the code.
Linux consists of several components:
Because of its open-source nature, Linux is highly customizable and can be tailored for specific tasks and environments. It is widely used in server environments, cloud computing, embedded systems, and by developers.
A Linux distribution (distro) is a complete operating system that includes the Linux kernel along with system libraries, utilities, software applications, and a package management system. The distribution determines how the system is configured and which applications come pre-installed. Some popular types of Linux distributions include:
Each distribution has its own package management system, system initialization process, and configuration utilities, which make them unique in terms of use cases and target audiences.
The Linux kernel is the core of the Linux operating system. It acts as an intermediary between the hardware of the computer and the software (applications and system tools). The kernel is responsible for managing system resources such as the CPU, memory, and storage devices. It also handles input/output (I/O) operations, device management, file systems, network communication, and security.
Key functions of the Linux kernel include:
The Linux kernel is modular, meaning that it can load and unload various modules (drivers and system components) as needed.
A shell in Linux is a command-line interface (CLI) that allows users to interact with the operating system by typing commands. It serves as an intermediary between the user and the kernel, interpreting the commands issued by the user and executing them. The shell processes commands and outputs the result to the terminal.
There are two main types of shells in Linux:
A shell provides an environment where users can run commands, run scripts, navigate the filesystem, and manage processes.
There are several types of shells available in Linux, each with its own syntax and features. Some of the most common shells include:
Each shell has its own strengths, and the choice of shell typically depends on user preferences, scripting requirements, and system environments.
In Linux, you can list all files in a directory using the ls command. This command displays the names of files and directories in the current directory or a specified directory.
Basic Syntax:
ls [options] [directory]
For example, to list the files in the current directory:
ls
To list all files, including hidden files (those starting with a dot):
ls -a
To list files with detailed information such as permissions, ownership, size, and modification date:
ls -l
To list all files, including hidden files, with detailed information:
ls -la
You can also use other options to sort the files by date, size, etc., like:
The chmod (change mode) command in Linux is used to change the file or directory permissions. It controls who can read, write, or execute a file. Linux file permissions are based on three categories: owner, group, and others. The chmod command can modify these permissions using either symbolic or numeric modes.
chmod is used for security purposes to restrict or grant access to files and directories.
In Linux, both hard links and soft (symbolic) links are used to link files, but they behave differently:
Hard links are more direct references to data, while soft links are more flexible and can link across filesystems or link to directories.
Linux file permissions control who can access files and directories and what actions they can perform on them. The basic permissions are:
Permissions are assigned to three categories:
A typical permission string looks like rwxr-xr--, where the first three characters represent the user's permissions, the next three are for the group, and the last three are for others.
The ls command in Linux is used to list the files and directories in a directory. It is one of the most frequently used commands in Linux, providing an overview of the contents of the specified directory.
The ls command is essential for navigating and managing files and directories in a Linux environment.
To check the current working directory in Linux, you can use the pwd (print working directory) command. This command shows the full path of the directory you are currently in.
Example:
pwd
Output might look like:
/home/user/Documents
This command is essential when navigating the file system to confirm your current location.
The pwd (print working directory) command in Linux is used to display the full absolute path of the current working directory. It tells you exactly where you are in the file system hierarchy.
Example:
pwd
Output example:
/home/user/Desktop
This command is helpful when you're working in a terminal session and want to verify your directory location.
The cd (change directory) command in Linux is used to navigate between directories. You provide the path to the directory you want to move to.
Basic Syntax:
cd [directory]
For example:
To go to the /home/user directory:
cd /home/user
To move up one directory level:
cd ..
To go to your home directory:
cd ~
To go to your home directory:
cd ~
To navigate to the previous directory:
cd -
The cd command is essential for navigating the filesystem in a terminal.
To copy a file in Linux, you use the cp (copy) command. This command allows you to create a duplicate of a file or directory at a specified location.
Basic Syntax:
cp [source] [destination]
For example:
To copy a file file.txt from the current directory to the /home/user/ directory:
cp file.txt /home/user/
To copy a directory (and its contents) recursively:
cp -r source_dir destination_dir
To preserve the file's attributes like timestamps and permissions while copying:
cp -p file.txt /home/user/
The cp command is essential for copying files between directories in Linux.
The mv (move) command in Linux is used to move or rename files and directories. If the destination directory is different, it moves the file; if the destination is a new name, it renames the file.
Basic Syntax:
mv [source] [destination]
For example:
To move a file file.txt from the current directory to /home/user/:
mv file.txt /home/user/
To rename a file:
mv old_name.txt new_name.txt
To move a directory and its contents:
mv source_dir /home/user/destination_dir
The mv command is versatile for both renaming and moving files and directories in Linux.
To delete a file in Linux, you use the rm (remove) command. This command permanently deletes files, so it should be used with caution.
Basic Syntax:
rm [file]
For example:
To remove a single file:
rm file.txt
To delete multiple files at once:
rm file1.txt file2.txt
To delete a directory and its contents recursively:
rm -r directory_name
To force deletion without confirmation (use carefully):
rm -f file.txt
The rm command is powerful, and files removed with it cannot be easily recovered.
A process in Linux is an instance of a running program. It consists of the program code, its current activity, and the system resources it uses. Each process has a unique process ID (PID) and can be in various states, such as running, sleeping, or stopped.
Processes can be categorized as:
Every process in Linux is assigned a unique PID, which is used by the system to manage and monitor the process. The Linux kernel uses these PIDs to track and schedule processes for execution.
To check running processes in Linux, you can use the ps (process status) command. The ps command shows information about active processes.
Basic Syntax:
ps
This will display processes running in the current terminal session. To see all processes running on the system, use:
ps aux
Where:
To get a dynamic, real-time view of running processes, you can use the top command, which provides a constantly updating list of processes and their resource usage.
The top command in Linux is used to display real-time information about the system's processes, resource usage (such as CPU, memory, and disk), and overall system performance. It's an interactive command that provides an overview of active processes.
Basic Syntax:
top
When you run top, it displays:
You can press certain keys while in the top interface to interact with it:
The top command is especially useful for identifying resource-heavy processes.
To kill a process in Linux, you can use the kill command, which sends a signal to a process to terminate it. By default, it sends a termination signal (SIGTERM) to the process.
Basic Syntax:
kill [PID]
Where PID is the process ID of the process you want to terminate. You can find the PID using commands like ps or top.
For example:
To kill a process with PID 1234:
kill 1234
If the process does not terminate with the default signal, you can use the -9 option to forcefully kill it (SIGKILL):
kill -9 1234
Alternatively, you can use killall to terminate a process by its name, which kills all processes with that name:
killall process_name
Caution: Be careful when using kill and especially kill -9 as it forces processes to stop immediately without cleaning up resources.
Both kill and killall are commands used to terminate processes in Linux, but they operate differently:
Syntax:
kill [PID]
For example, if you want to kill a process with PID 1234:
kill 1234
Syntax:
killall [process_name]
For example, to kill all processes named firefox:
killall firefox
In summary:
The grep command in Linux is used for searching text within files or output from other commands. It searches for a specified pattern or regular expression and prints lines containing that pattern.
Basic Syntax:
grep [options] pattern [file]
For example:
To search for the word "error" in a file called logfile.txt:
grep "error" logfile.txt
To search for a pattern in the output of another command (e.g., finding processes containing the word apache):
ps aux | grep apache
Common grep options:
The grep command is extremely useful for searching through large files or outputs for specific information.
In Linux, you can redirect the output of a command to a file using the > (overwrite) or >> (append) operators. This is useful for saving the output of a command to a file instead of displaying it on the terminal.
Overwrite (with >): Redirects output to a file, overwriting any existing content.
echo "Hello, World!" > output.txt
Append (with >>): Redirects output to a file, appending it to the end of the file.
echo "Hello again!" >> output.txt
Redirecting standard error: If you want to capture both standard output (stdout) and standard error (stderr) in the same file:
command > output.txt 2>&1
Redirecting output to files is a fundamental aspect of working with Linux commands and is often used for logging and file manipulation.
The echo command in Linux is used to print text or output to the terminal. It is often used in scripts or command-line operations to display messages or the value of variables.
Basic Syntax:
echo [options] [string]
For example:
To print a simple message:
echo "Hello, World!"
To print the value of a variable:
name="Alice"
echo "Hello, $name"
Common options:
-n: Prevents the trailing newline character.
echo -n "Hello, "
echo "World!"
-e: Enables interpretation of backslash escapes (e.g., \n for a new line).
echo -e "Hello\nWorld!"
The echo command is commonly used in scripts, shell configurations, and for testing purposes.
The cat (concatenate) command in Linux is used to display the content of files on the terminal, combine multiple files, or create new files by redirecting input.
Basic Syntax:
cat [options] [file(s)]
For example:
To display the contents of a file:
cat file.txt
To concatenate (combine) two files:
cat file1.txt file2.txt
To create a new file by typing input (press Ctrl+D to end the input):
cat > newfile.txt
To number the lines of a file:
cat -n file.txt
The cat command is very useful for viewing and manipulating file content directly from the terminal.
The /etc/passwd file in Linux is a text file that contains essential information about user accounts on the system. It defines user details such as the username, password (or placeholder), user ID (UID), group ID (GID), home directory, and default shell.
Each line in /etc/passwd represents one user account, and the fields are separated by colons (:). The general format of each line is:
username:password:UID:GID:GECOS:home_directory:shell
Example:
johndoe:x:1001:1001:John Doe:/home/johndoe:/bin/bash
This file is critical for user management on the system, and only the root user typically has permission to modify it.
To create a new user in Linux, you can use the useradd command followed by the desired username. After creating a user, you can set the user's password using the passwd command.
Basic Syntax:
sudo useradd [username]
sudo passwd [username]
For example:
To create a user named johndoe:
sudo useradd johndoe
To set a password for the new user:
sudo passwd johndoe
You can also specify additional options, such as definin a home directory, shell, or group for the user:
sudo useradd -m -s /bin/bash -G sudo johndoe
The /etc/group file in Linux defines the groups to which users belong. This file provides information about user groups, including group names, GIDs, and member usernames. It allows for more efficient management of user permissions, as users in a group can inherit specific access rights for files and directories.
Each line in /etc/group represents one group, with fields separated by colons (:). The general format of each line is:
group_name:password:GID:user_list
Example:
sudo:x:27:johndoe,alice
The /etc/group file is used to manage group-based permissions and is typically modified by administrators.
To check free disk space in Linux, you can use the df (disk free) command. This command displays information about the available and used disk space on the file system.
Basic Syntax:
df [options]
For example:
To display the disk usage for all mounted file systems:
df
To display disk usage in a human-readable format (with KB, MB, or GB):
df -h
To display disk usage for a specific file system or directory:
df /home
The df command provides a quick way to check overall disk space usage.
The df command is used to display the amount of disk space available on the file system, including both used and available space. By default, it shows information about all mounted file systems.
Basic Syntax:
df [options] [file]
For example:
To show disk usage for all mounted file systems:
df
To display disk usage in a human-readable format (with units such as GB or MB)
df -h
The df command is very useful for monitoring disk space and ensuring that the system does not run out of space. You can also specify a particular file or directory to check its disk usage.
The du (disk usage) command in Linux is used to estimate the disk space used by files and directories. It displays the amount of disk space consumed by files and directories, helping you determine how much space is being used on a system.
Basic Syntax:
du [options] [directory]
For example:
To check the disk usage of the current directory:
du
To check the disk usage of a specific directory:
du /path/to/directory
To display the disk usage in a human-readable format (with units like KB, MB, GB):
du -h
To check the total disk usage for a directory and its subdirectories:
du -sh /path/to/directory
The du command is useful for identifying which directories or files are taking up the most disk space.