A-Z Linux Commands Reference Guide

A

  • a2enmod / a2dismod: Enable or disable Apache2 modules.

  • a2ensite / a2dissite: Enable or disable Apache2 virtual hosts.

  • alias: Create a shortcut for a long command.

    • alias ll='ls -la'

  • apt / apt-get: Package management tools for Debian/Ubuntu.

  • awk: Pattern scanning and text processing language.

B

  • bash: The default command-line shell.

  • bg: Sends a process to the background.

  • bzip2: Compresses or expands .bz2 files.

C

  • cat: Display file contents or combine files.

  • cd: Change directory.

    • cd /var/www

  • chmod: Change file/directory permissions (e.g., 755, 644).

  • chown: Change file/directory owner and group.

  • clear: Clear the terminal screen.

  • cp: Copy files or directories (-r for recursive).

  • curl: Transfer data from or to a server (supports HTTP, FTP, etc.).

  • crontab: Schedule recurring tasks.

D

  • date: Display or set system date and time.

  • dd: Convert and copy a file (commonly used to create bootable USBs).

  • df: Display free disk space on the filesystem.

  • diff: Compare two files line by line.

  • dig: DNS lookup utility.

  • du: Estimate file space usage (disk usage).

E

  • echo: Print text to the terminal.

  • exit: Close the current terminal or logout.

  • export: Set environment variables.

F

  • fdisk: Partition table manipulator for Linux.

  • find: Search for files in a directory hierarchy.

  • free: Display amount of free and used memory (RAM).

G

  • grep: Search for patterns inside text/files. (Crucial)

    • grep "error" log.txt

  • gzip / gunzip: Compress or decompress .gz files.

H

  • head: Output the first part of files (default 10 lines).

  • history: Display the command history list.

  • hostname: Show or set the system's host name.

I

  • ifconfig / ip: Configure network interfaces ( ip a is the modern version).

  • iptables: Administration tool for IPv4 packet filtering and NAT (Firewall).

J

  • jobs: List active jobs in the current shell.

  • journalctl: Query and display logs from the systemd journal.

K

  • kill: Terminate a process using its PID.

    • kill -9 1234

L

  • ls: List directory contents.

    • ls -lh

  • ln: Create links between files (use -s for symbolic links).

  • locate: Find files by name (faster than find, uses a database).

M

  • man: An interface to the system reference manuals (Help).

  • mkdir: Create a new directory.

  • mv: Move or rename files/directories.

N

  • nano / vi / vim: Command-line text editors.

  • netstat: Print network connections, routing tables, etc.

P

  • passwd: Change user password.

  • ping: Send ICMP ECHO_REQUEST to network hosts.

  • ps: Report a snapshot of the current processes.

  • pwd: Print Working Directory (shows where you are).

R

  • rm: Remove files or directories (rm -rf to force delete).

  • rmdir: Remove empty directories.

S

  • scp: Securely copy files between hosts over SSH.

  • sed: Stream editor for filtering and transforming text.

  • ssh: Secure Shell client (remote login).

  • sudo: Execute a command as another user (usually root).

T

  • tail: Output the last part of files (use -f to follow live logs).

  • tar: Archiving utility (tape archiver).

    • tar -cvzf archive.tar.gz /path

  • top: Display Linux processes (interactive task manager).

  • touch: Create an empty file or update timestamps.

U

  • uname: Print system information (uname -a).

  • uptime: Tell how long the system has been running.

W

  • w / who: Show who is logged on and what they are doing.

  • wget: Non-interactive network downloader.

Z

  • zip / unzip: Package and compress (archive) files.

Was this answer helpful?