Linux commands organized by category.

Basic Navigation

Command
pwd
Description

Displays the current working directory.

Command
cd
Description

Changes the current working directory.

Command
cd ..
Description

Moves to the parent directory.

Command
ls
Description

Lists files and directories in the current location.

Command
ls -la
Description

Lists all files and directories, including hidden ones, in detailed format.

Command
man <command>
Description

Displays the manual page for a command.

Command
<command> --help
Description

Displays available options for a command.

File & Directory Operations

Command
mkdir
Description

Creates a new directory.

Command
touch
Description

Creates a new empty file.

Command
cp
Description

Copies a file or directory without modifying the original.

Command
cp -r
Description

Copies a directory and its contents recursively.

Command
mv
Description

Moves or renames a file or directory.

Command
rm
Description

Deletes a file.

Command
rm -r
Description

Deletes a directory and its contents recursively.

Command
rmdir
Description

Removes an empty directory.

Command
cat
Description

Displays the contents of a file.

Command
nano
Description

Opens a file in a simple terminal-based text editor.

Command
echo "text" > file
Description

Creates a file containing the given text.

Command
echo $PATH
Description

Displays the system's executable search paths.

Command
less
Description

Views file contents one page at a time; press q to quit.

Command
head
Description

Displays the first lines of a file.

Command
tail
Description

Displays the last lines of a file.

Command
tail -f
Description

Continuously displays new lines appended to a file — commonly used to monitor logs in real time.

User & Permissions

Command
passwd
Description

Changes the password of the current user.

Command
sudo su
Description

Switches to the root user; use exit to return to the normal user.

Command
lsattr
Description

Displays the attributes of a file, such as the immutable flag (i).

Command
chattr -i
Description

Removes the immutable attribute from a file, making it editable again.

User & Group Management

Command
useradd -m -s /bin/bash <username>
Description

Creates a new user with a home directory and bash shell.

Command
usermod -aG sudo <username>
Description

Adds a user to the sudo group.

Command
userdel -r <username>
Description

Deletes a user along with their home directory.

Command
groupadd <groupname>
Description

Creates a new group.

Command
groups <username>
Description

Displays the groups a user belongs to.

Command
id <username>
Description

Displays UID, GID, and group membership of a user.

Command
whoami
Description

Displays the current logged-in username.

Package Management

Command
apt update
Description

Refreshes the local list of available packages and their versions.

Command
apt install
Description

Installs a specified package.

Command
apt upgrade
Description

Upgrades all installed packages to their latest available versions.

Command
apt search
Description

Searches available repositories for a package.

Networking

Command
ifconfig
Description

Displays network interface configuration, including IP address. Still functional on most systems, but no longer actively maintained — ip addr is the modern, recommended alternative.

Command
ip addr
Description

Displays and manages network interface addresses; the modern replacement for ifconfig.

Command
netstat / ss
Description

Displays active network connections and listening ports.

Process Management

Command
ps aux
Description

Displays currently running processes.

Command
top
Description

Shows a live view of system processes.

Command
htop
Description

Displays an enhanced, interactive process monitor.

Command
kill <PID>
Description

Terminates a process by its process ID.

Command
pstree
Description

Displays running processes in a tree structure.

System Information

Command
uname -a
Description

Displays kernel and system information.

Command
lsb_release -a
Description

Displays OS/distribution information.

Command
uptime
Description

Shows how long the system has been running.

Command
free -m
Description

Displays RAM usage in megabytes.

Command
cal
Description

Displays a calendar.

Command
fdisk -l
Description

Lists disks and partitions.

Command
df -h
Description

Displays disk space usage per partition in a human-readable format.

Command
du -h
Description

Displays the disk space used by a file or directory in a human-readable format.

Terminal Shortcuts

Command
clear
Description

Clears the terminal screen.

Command
Ctrl + L
Description

Clears the terminal (same as clear).

Command
!!
Description

Re-runs the last executed command.

Command
Ctrl + Z
Description

Sends the current process to the background.

Command
history
Description

Displays a list of previously executed commands.

Misc / GUI & Version Control

Command
sudo thunar
Description

Opens the Thunar file manager with root privileges.

Command
git clone
Description

Downloads a copy of a remote Git repository to the local machine.

File Permissions

Command
chmod
Description

Changes the read, write, and execute permissions of a file or directory.

Command
chown
Description

Changes the owner of a file or directory.

Command
chgrp
Description

Changes the group ownership of a file or directory.

Search & Find

Command
find
Description

Searches for files and directories matching given criteria.

Command
grep
Description

Searches for text patterns within files.

Command
which <command>
Description

Displays the full path of an installed command.

Command
whereis <command>
Description

Locates the binary, source, and manual page files for a command.

Command
wc
Description

Counts lines, words, and characters in a file.

Command
diff
Description

Compares two files and shows the differences between them.

Archive & Transfer

Command
tar
Description

Archives or extracts files, often combined with compression.

Command
wget
Description

Downloads files from the web directly via the command line.

Command
curl
Description

Transfers data to or from a server; commonly used for testing APIs or downloading files.

Command
zip
Description

Compresses files into a .zip archive.

Command
unzip
Description

Extracts files from a .zip archive.

Command
rsync
Description

Synchronizes files and directories between locations, transferring only the differences.

Network Diagnostics

Command
ping
Description

Tests reachability of a host over the network.

Command
traceroute
Description

Displays the network path (hops) taken to reach a host.

Remote Access

Command
ssh user@host
Description

Connects to a remote machine over SSH.

Command
scp file user@host:/path
Description

Securely copies a file to or from a remote machine over SSH.

File System Structure

Command
/bin
Description

Contains essential commands and programs run by regular users.

Command
/sbin
Description

Contains system commands and programs typically run by the root user.

Command
/etc
Description

Contains system-wide configuration files.

Command
/home
Description

Contains personal directories for regular users.

Command
/root
Description

The home directory of the root user (not to be confused with /, the root of the filesystem).

Command
/var
Description

Contains variable data that changes while the system runs, such as log files.

Command
/tmp
Description

Contains temporary files and directories.

Command
/run
Description

Contains runtime data since the last boot, such as process IDs.

Command
/dev
Description

Contains device files representing hardware components.

Command
/proc
Description

Stores information about currently running processes.

Command
/sys
Description

Provides an interface to kernel and hardware information (similar to /proc).

Command
/mnt
Description

Used for temporarily mounting filesystems.

Command
/media
Description

Contains mount points for removable storage devices.

Command
/usr
Description

The primary directory for user applications and their associated files.

Command
/lib
Description

Contains shared libraries and kernel modules.

Command
/opt
Description

Contains optional, third-party software packages.

Command
/boot
Description

Contains critical files required to boot the operating system; deleting this as root can render the system unbootable.

Command
/srv
Description

Contains data related to services provided by the system.