Linux commands organized by category.
Basic Navigation
pwd
Description
Displays the current working directory.
cd
Description
Changes the current working directory.
cd ..
Description
Moves to the parent directory.
ls
Description
Lists files and directories in the current location.
ls -la
Description
Lists all files and directories, including hidden ones, in detailed format.
man <command>
Description
Displays the manual page for a command.
<command> --help
Description
Displays available options for a command.
File & Directory Operations
mkdir
Description
Creates a new directory.
touch
Description
Creates a new empty file.
cp
Description
Copies a file or directory without modifying the original.
cp -r
Description
Copies a directory and its contents recursively.
mv
Description
Moves or renames a file or directory.
rm
Description
Deletes a file.
rm -r
Description
Deletes a directory and its contents recursively.
rmdir
Description
Removes an empty directory.
cat
Description
Displays the contents of a file.
nano
Description
Opens a file in a simple terminal-based text editor.
echo "text" > file
Description
Creates a file containing the given text.
echo $PATH
Description
Displays the system's executable search paths.
less
Description
Views file contents one page at a time; press q to quit.
head
Description
Displays the first lines of a file.
tail
Description
Displays the last lines of a file.
tail -f
Description
Continuously displays new lines appended to a file — commonly used to monitor logs in real time.
User & Permissions
passwd
Description
Changes the password of the current user.
sudo su
Description
Switches to the root user; use exit to return to the normal user.
lsattr
Description
Displays the attributes of a file, such as the immutable flag (i).
chattr -i
Description
Removes the immutable attribute from a file, making it editable again.
User & Group Management
useradd -m -s /bin/bash <username>
Description
Creates a new user with a home directory and bash shell.
usermod -aG sudo <username>
Description
Adds a user to the sudo group.
userdel -r <username>
Description
Deletes a user along with their home directory.
groupadd <groupname>
Description
Creates a new group.
groups <username>
Description
Displays the groups a user belongs to.
id <username>
Description
Displays UID, GID, and group membership of a user.
whoami
Description
Displays the current logged-in username.
Package Management
apt update
Description
Refreshes the local list of available packages and their versions.
apt install
Description
Installs a specified package.
apt upgrade
Description
Upgrades all installed packages to their latest available versions.
apt search
Description
Searches available repositories for a package.
Networking
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.
ip addr
Description
Displays and manages network interface addresses; the modern replacement for ifconfig.
netstat / ss
Description
Displays active network connections and listening ports.
Process Management
ps aux
Description
Displays currently running processes.
top
Description
Shows a live view of system processes.
htop
Description
Displays an enhanced, interactive process monitor.
kill <PID>
Description
Terminates a process by its process ID.
pstree
Description
Displays running processes in a tree structure.
System Information
uname -a
Description
Displays kernel and system information.
lsb_release -a
Description
Displays OS/distribution information.
uptime
Description
Shows how long the system has been running.
free -m
Description
Displays RAM usage in megabytes.
cal
Description
Displays a calendar.
fdisk -l
Description
Lists disks and partitions.
df -h
Description
Displays disk space usage per partition in a human-readable format.
du -h
Description
Displays the disk space used by a file or directory in a human-readable format.
Terminal Shortcuts
clear
Description
Clears the terminal screen.
Ctrl + L
Description
Clears the terminal (same as clear).
!!
Description
Re-runs the last executed command.
Ctrl + Z
Description
Sends the current process to the background.
history
Description
Displays a list of previously executed commands.
Misc / GUI & Version Control
sudo thunar
Description
Opens the Thunar file manager with root privileges.
git clone
Description
Downloads a copy of a remote Git repository to the local machine.
File Permissions
chmod
Description
Changes the read, write, and execute permissions of a file or directory.
chown
Description
Changes the owner of a file or directory.
chgrp
Description
Changes the group ownership of a file or directory.
Search & Find
find
Description
Searches for files and directories matching given criteria.
grep
Description
Searches for text patterns within files.
which <command>
Description
Displays the full path of an installed command.
whereis <command>
Description
Locates the binary, source, and manual page files for a command.
wc
Description
Counts lines, words, and characters in a file.
diff
Description
Compares two files and shows the differences between them.
Archive & Transfer
tar
Description
Archives or extracts files, often combined with compression.
wget
Description
Downloads files from the web directly via the command line.
curl
Description
Transfers data to or from a server; commonly used for testing APIs or downloading files.
zip
Description
Compresses files into a .zip archive.
unzip
Description
Extracts files from a .zip archive.
rsync
Description
Synchronizes files and directories between locations, transferring only the differences.
Network Diagnostics
ping
Description
Tests reachability of a host over the network.
traceroute
Description
Displays the network path (hops) taken to reach a host.
Remote Access
ssh user@host
Description
Connects to a remote machine over SSH.
scp file user@host:/path
Description
Securely copies a file to or from a remote machine over SSH.
File System Structure
/bin
Description
Contains essential commands and programs run by regular users.
/sbin
Description
Contains system commands and programs typically run by the root user.
/etc
Description
Contains system-wide configuration files.
/home
Description
Contains personal directories for regular users.
/root
Description
The home directory of the root user (not to be confused with /, the root of the filesystem).
/var
Description
Contains variable data that changes while the system runs, such as log files.
/tmp
Description
Contains temporary files and directories.
/run
Description
Contains runtime data since the last boot, such as process IDs.
/dev
Description
Contains device files representing hardware components.
/proc
Description
Stores information about currently running processes.
/sys
Description
Provides an interface to kernel and hardware information (similar to /proc).
/mnt
Description
Used for temporarily mounting filesystems.
/media
Description
Contains mount points for removable storage devices.
/usr
Description
The primary directory for user applications and their associated files.
/lib
Description
Contains shared libraries and kernel modules.
/opt
Description
Contains optional, third-party software packages.
/boot
Description
Contains critical files required to boot the operating system; deleting this as root can render the system unbootable.
/srv
Description
Contains data related to services provided by the system.