System Administration
Updated for 2026

Linux Commands Cheatsheet 2026

Interactive handbook for terminal navigation, file administration, permissions, process handling, and basic networking utilities.

Target Version Compatibility

Interactive Skill Mastery

Mark commands as learned to build your customized reference tracker. Retained locally in this browser.

Level:Novice
Command Mastery Progress0 of 27 Mastered (0%)

Navigation

pwd
BeginnerBasics
Print Working Directory: display the absolute path of your current folder location.

When to Use

When exploring directory trees and listing file statistics inside your active shell session.

Common Mistakes

Using backslashes (\) like Windows instead of forward slashes (/) for folder paths.

Shortcut / Pro-Tip

Press 'Tab' key once or twice to trigger autocomplete for directories and files.

Example

pwd

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
ls -la
BeginnerBasics
List directory contents showing detailed permissions, owners, sizes, and hidden files.

When to Use

When listing directory contents and you need to review hidden files (starting with dot, like .env or .git) alongside permissions and owners.

Common Mistakes

Thinking the system is frozen because 'ls -la' output is extremely long. Pipette it to a pager if needed.

Shortcut / Pro-Tip

Create shell alias: alias ll='ls -la'

Example

ls -la

Output Example

Console / Terminal
drwxr-xr-x  14 admin  staff    448 Jul 12 09:00 .
drwxr-xr-x+ 78 admin  staff   2496 Jul 12 08:30 ..
-rw-r--r--   1 admin  staff    350 Jul 12 09:12 .env
-rw-r--r--   1 admin  staff   1024 Jul 12 09:00 package.json
cd <directory_path>
BeginnerBasics
Change directory: transition to a different folder path in the system.

When to Use

When exploring directory trees and listing file statistics inside your active shell session.

Common Mistakes

Using backslashes (\) like Windows instead of forward slashes (/) for folder paths.

Shortcut / Pro-Tip

Press 'Tab' key once or twice to trigger autocomplete for directories and files.

Example

cd <directory_path>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
cd ..
BeginnerBasics
Navigate up one level in the directory hierarchy.

When to Use

When exploring directory trees and listing file statistics inside your active shell session.

Common Mistakes

Using backslashes (\) like Windows instead of forward slashes (/) for folder paths.

Shortcut / Pro-Tip

Press 'Tab' key once or twice to trigger autocomplete for directories and files.

Example

cd ..

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

File Ops

mkdir <name>
BeginnerBasics
Make Directory: create a new empty directory with the specified name.

When to Use

When modifying filesystems—creating, moving, copying, or permanently deleting folders and files.

Common Mistakes

Deleting essential files recursively with 'rm -rf' without verifying path arguments.

Shortcut / Pro-Tip

Use 'mv' for both moving files and renaming them inside the same directory.

Example

mkdir <name>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
rm -rf <path>
BeginnerBasics
Remove file or folder forcefully and recursively. Use with extreme caution.

When to Use

When you absolutely must delete a directory and all of its nested contents (e.g. cleaning a bloated node_modules folder).

Common Mistakes

Executing this command with typos, especially with a leading slash or wildcard (e.g. 'rm -rf /' or 'rm -rf *' on wrong working folder).

Shortcut / Pro-Tip

Use with caution. Always type 'pwd' first to double-check which directory you are currently in.

Example

rm -rf node_modules

Output Example

Console / Terminal
(Forcefully deletes the directory. No confirmation prompt or output is returned)
cp -r <source> <destination>
BeginnerBasics
Copy files or directories recursively to a new target path.

When to Use

When modifying filesystems—creating, moving, copying, or permanently deleting folders and files.

Common Mistakes

Deleting essential files recursively with 'rm -rf' without verifying path arguments.

Shortcut / Pro-Tip

Use 'mv' for both moving files and renaming them inside the same directory.

Example

cp -r <source> <destination>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
mv <source> <destination>
BeginnerBasics
Move or rename files/directories from source to target destination.

When to Use

When modifying filesystems—creating, moving, copying, or permanently deleting folders and files.

Common Mistakes

Deleting essential files recursively with 'rm -rf' without verifying path arguments.

Shortcut / Pro-Tip

Use 'mv' for both moving files and renaming them inside the same directory.

Example

mv <source> <destination>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
touch <file>
BeginnerBasics
Create an empty file or update the modified timestamp of an existing file.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

touch <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
cat <file>
BeginnerBasics
Concatenate and display the text content of a file in the terminal stream.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

cat <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
grep "<pattern>" <file>
BeginnerBasics
Search and highlight a text pattern or regular expression in a file.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

grep "<pattern>" <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
find /path -name "*.txt"
BeginnerBasics
Search the filesystem for files matching a specific name pattern.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

find /path -name "*.txt"

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

System Info

df -h
BeginnerBasics
Disk Free: display available disk space across filesystems in human-readable format.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

df -h

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
du -sh *
BeginnerBasics
Disk Usage: display total size of files and folders in the current directory.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

du -sh *

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
uname -a
BeginnerBasics
Print system information including kernel details and architecture specifications.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

uname -a

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
free -m
BeginnerBasics
Display free and used physical RAM and swap memory capacity in Megabytes.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

free -m

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

Permissions

chmod +x <file>
BeginnerBasics
Change Mode: make a specified file executable.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

chmod +x <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
chmod 755 <file>
BeginnerBasics
Grant read/write/execute permissions to owner, and read/execute to others.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

chmod 755 <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
chown <user>:<group> <file>
BeginnerBasics
Change Owner: reassign file ownership to a specific user and group.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

chown <user>:<group> <file>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

Processes

ps aux
BeginnerBasics
Process Status: list all active processes running on the system with detailed columns.

When to Use

When monitoring background execution states, evaluating RAM/CPU loads, or terminating unresponsive software applications.

Common Mistakes

Killing processes indiscriminately, causing system instability or uncommitted data loss.

Shortcut / Pro-Tip

Use 'killall <process_name>' to kill all instances of a program simultaneously.

Example

ps aux

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
top
BeginnerBasics
Display a live, interactive CPU and memory process monitor.

When to Use

When monitoring background execution states, evaluating RAM/CPU loads, or terminating unresponsive software applications.

Common Mistakes

Killing processes indiscriminately, causing system instability or uncommitted data loss.

Shortcut / Pro-Tip

Use 'killall <process_name>' to kill all instances of a program simultaneously.

Example

top

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
kill -9 <pid>
BeginnerBasics
Kill process: forcefully terminate a process immediately using its ID.

When to Use

When monitoring background execution states, evaluating RAM/CPU loads, or terminating unresponsive software applications.

Common Mistakes

Killing processes indiscriminately, causing system instability or uncommitted data loss.

Shortcut / Pro-Tip

Use 'killall <process_name>' to kill all instances of a program simultaneously.

Example

kill -9 <pid>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
htop
BeginnerBasics
Launch a colorful, user-friendly, interactive process inspector (if installed).

When to Use

When monitoring background execution states, evaluating RAM/CPU loads, or terminating unresponsive software applications.

Common Mistakes

Killing processes indiscriminately, causing system instability or uncommitted data loss.

Shortcut / Pro-Tip

Use 'killall <process_name>' to kill all instances of a program simultaneously.

Example

htop

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

Network

curl -I <url>
BeginnerBasics
Fetch only the HTTP headers from a specified web address.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

curl -I <url>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
ping <host>
BeginnerBasics
Send ICMP echo request packets to a remote host to test connection and latency.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

ping <host>

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
netstat -tuln
BeginnerBasics
Show active TCP/UDP ports currently listening on the machine.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

netstat -tuln

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)
ip addr show
BeginnerBasics
Display network interface controllers, configuration states, and IP addresses.

When to Use

Use this shell command in your Linux/bash terminal to perform system admin, directory exploration, or process tasks.

Common Mistakes

Typing arguments incorrectly or executing commands with administrative superuser privileges (sudo) unnecessarily.

Shortcut / Pro-Tip

Use the Up/Down arrow keys to browse through your local shell terminal command history.

Example

ip addr show

Output Example

Console / Terminal
Success. (Command executed on system, check outputs)

Linux Commands Best Practices

1Never Run as Root Unnecessarily

Avoid logging in as root. Run commands with normal privileges and use 'sudo' selectively for admin actions.

2Use Relative Paths for Local Work

Keep local file operations simple and safe by avoiding raw absolute paths when executing file creations.

3Double-Check Destructive Commands

Always run pwd to verify your working folder before executing rm or recursive move commands.

4Write Modular Bash Scripts

Isolate terminal automations in clean, permission-restricted executable scripts ending in .sh.

5Leverage Pipelining with Pipe (|)

Chain simple, modular tools together (e.g. cat logs.txt | grep 'ERROR' | wc -l) to extract precise terminal records.

Common Linux Commands Errors & Solutions

Error

Permission denied

Solution

Prepend 'sudo' to run as root, or check file permission states with 'chmod +x <file>' or 'chown'.

Error

Command not found

Solution

The executable is missing or not in your system $PATH. Check package installs or use full paths (e.g. ./script.sh).

Error

No space left on device

Solution

Run 'df -h' to check disk levels, and 'du -sh *' to find heavy cache directories or logs that need purging.

Error

File name too long or ambiguous

Solution

Wrap directory paths containing spaces inside quotes (e.g. cd "my documents") to prevent syntax interpretation errors.

Error

Connection refused

Solution

A network port is blocked, or the background server is offline. Check active listeners with 'netstat -tuln'.

Common Linux Commands Interview Questions

Q1What do the permissions rwxr-xr-x (or chmod 755) represent?

The permissions represent: owner can read, write, and execute (7/rwx); group can read and execute (5/r-x); other users can read and execute (5/r-x).

Q2What is the difference between hard links and soft (symbolic) links?

A hard link points directly to the physical inode of the file on disk. A soft link is a shortcut pointing to the filename path; if the source file is deleted, the soft link breaks.

Q3What does the pipe (|) operator do in Linux?

The pipe operator redirects the standard output (stdout) stream of the first command directly into the standard input (stdin) of the second command.

Q4How do you monitor system processes in real-time?

Use top or htop inside the terminal to display a live, interactive, resource-sorted list of running CPU and memory processes.

Q5What is the difference between backgrounding a task with & and using nohup?

Adding & runs a task in the terminal background but terminates if the shell closes. nohup prevents the task from receiving the HUP (hang up) signal, keeping it running even after logout.