GO KALI FREE
BeginnerLinux

100 Essential Linux Commands Every Beginner Should Know

A quick-reference cheat sheet of 100 essential Linux commands every beginner should know, organized by category with syntax, examples, and practical use cases for system administration and cybersecurity.

#Linux commands#terminal#command line#bash#Linux basics#system administration#Linux tutorial

Why Master Linux Commands?

When you sit down at a terminal for the first time, the blinking cursor can feel intimidating. But every cybersecurity professional, system administrator, and DevOps engineer started in exactly the same place. The terminal is where real work happens on Linux — from configuring firewalls and managing services to analyzing logs and running security scans. Unlike a graphical desktop, the command line lets you chain tools together, automate repetitive tasks, and access every part of the operating system with a few keystrokes.

Below is a categorized reference of 100 commands you will encounter constantly while working with Linux, whether you are hardening a server, troubleshooting a network issue, or learning ethical hacking on Kali. Each entry includes the syntax, a concrete example, and a short note on when you would actually reach for it.

Table of Contents

  • File System Navigation (10 commands)
  • File Operations (15 commands)
  • Text Processing (10 commands)
  • Permission Management (8 commands)
  • Process Management (10 commands)
  • Network Commands (12 commands)
  • System Information (10 commands)
  • Disk and Storage (8 commands)
  • Package Management (7 commands)
  • User Management (5 commands)
  • Compression and Archives (5 commands)
  • Miscellaneous (10 commands)
  • File System Navigation

    These commands help you move around the Linux filesystem.

  • **pwd** — Print working directory. Shows your current location in the filesystem.
  • **ls** — List directory contents. Use `ls -la` for detailed listing with hidden files.
  • **cd** — Change directory. `cd ..` goes up one level, `cd ~` goes to home.
  • **tree** — Display directory tree structure. `tree -L 2` shows two levels deep.
  • **find** — Search for files. `find / -name "*.log" 2>/dev/null` finds all log files.
  • **locate** — Quick file search using a pre-built database. Faster than find for simple searches.
  • **realpath** — Show the full path of a file or directory.
  • **readlink** — Display the symbolic link target.
  • **basename** — Extract filename from a path. `basename /etc/passwd` returns "passwd".
  • **dirname** — Extract directory from a path. `dirname /etc/passwd` returns "/etc".
  • File Operations

    Creating, copying, moving, and deleting files are everyday tasks.

  • **cp** — Copy files. `cp -r dir1 dir2` copies directories recursively.
  • **mv** — Move or rename files. `mv old.txt new.txt` renames a file.
  • **rm** — Remove files. `rm -rf dir` removes directories recursively (use with caution).
  • **mkdir** — Create directories. `mkdir -p path/to/dir` creates parent directories.
  • **touch** — Create empty files or update timestamps. `touch file.txt` creates an empty file.
  • **cat** — Display file contents. `cat file.txt` shows the entire file.
  • **less** — View file contents page by page. Press q to quit.
  • **head** — Show first lines of a file. `head -n 20 file.txt` shows first 20 lines.
  • **tail** — Show last lines of a file. `tail -f /var/log/syslog` follows log output.
  • **wc** — Word count. `wc -l file.txt` counts lines in a file.
  • **diff** — Compare files line by line.
  • **cmp** — Compare files byte by byte.
  • **link** — Create hard links to files.
  • **ln** — Create symbolic links. `ln -s /path/to/file linkname` creates a symlink.
  • **stat** — Display detailed file information including timestamps and permissions.
  • Text Processing

    Linux excels at text manipulation. These commands are essential for log analysis and data processing.

  • **grep** — Search text patterns. `grep -r "error" /var/log/` searches recursively.
  • **awk** — Pattern scanning and processing. `awk '{print $1}' file` prints first column.
  • **sed** — Stream editor for filtering and transforming text.
  • **cut** — Remove sections from lines. `cut -d: -f1 /etc/passwd` extracts usernames.
  • **sort** — Sort lines of text files. `sort -u file` sorts and removes duplicates.
  • **uniq** — Filter duplicate lines. Usually used after sort.
  • **tr** — Translate or delete characters. `echo "hello" | tr 'h' 'H'` outputs "Hello".
  • **tee** — Read from stdin and write to stdout and files simultaneously.
  • **xargs** — Build command lines from stdin. `find . -name "*.tmp" | xargs rm`.
  • **paste** — Merge lines of files side by side.
  • Permission Management

    Linux permissions control who can read, write, and execute files.

  • **chmod** — Change file permissions. `chmod 755 file` sets rwxr-xr-x.
  • **chown** — Change file ownership. `chown user:group file`.
  • **chgrp** — Change group ownership of files.
  • **umask** — Set default file creation permissions.
  • **su** — Switch user. `su - username` switches to another user.
  • **sudo** — Execute commands as root user.
  • **sudo -i** — Open a root shell.
  • **visudo** — Safely edit the sudoers file.
  • Process Management

    Control and monitor running processes.

  • **ps** — List processes. `ps aux` shows all running processes.
  • **top** — Real-time process monitor. Shows CPU, memory, and process details.
  • **htop** — Interactive process viewer (enhanced top).
  • **kill** — Terminate processes. `kill -9 PID` forces termination.
  • **killall** — Kill processes by name. `killall firefox`.
  • **pkill** — Kill processes matching a pattern.
  • **pgrep** — Find processes by name. `pgrep -l nginx`.
  • **jobs** — List background jobs.
  • **bg** — Resume suspended jobs in background.
  • **fg** — Bring background jobs to foreground.
  • Network Commands

    Essential for network analysis and security testing.

  • **ip** — Modern network configuration. `ip addr show` displays interfaces.
  • **ifconfig** — Legacy network configuration (replaced by ip).
  • **ping** — Test network connectivity. `ping -c 4 google.com`.
  • **traceroute** — Trace network path to a destination.
  • **netstat** — Network statistics. `netstat -tuln` shows listening ports.
  • **ss** — Socket statistics (modern netstat replacement).
  • **curl** — Transfer data from URLs. `curl -I https://example.com` fetches headers.
  • **wget** — Download files from the web.
  • **nslookup** — Query DNS records.
  • **dig** — DNS lookup tool (more detailed than nslookup).
  • **host** — Simple DNS lookup utility.
  • **arp** — Address Resolution Protocol table. `arp -a` shows ARP cache.
  • System Information

    Get details about your system hardware and software.

  • **uname** — System information. `uname -a` shows all details.
  • **hostname** — Display or set the system hostname.
  • **uptime** — Show system uptime and load averages.
  • **free** — Memory usage. `free -h` shows human-readable format.
  • **df** — Disk space usage. `df -h` shows human-readable sizes.
  • **du** — Directory size. `du -sh /var` shows total size.
  • **lsblk** — List block devices (disks and partitions).
  • **lscpu** — CPU information.
  • **lsmem** — Memory information.
  • **dmesg** — Kernel ring buffer messages (useful for hardware debugging).
  • Disk and Storage

    Manage disks, partitions, and file systems.

  • **fdisk** — Partition table manipulator. `sudo fdisk -l` lists all partitions.
  • **mount** — Mount file systems. `sudo mount /dev/sdb1 /mnt`.
  • **umount** — Unmount file systems.
  • **blkid** — Display block device attributes (UUID, filesystem type).
  • **fsck** — File system check and repair.
  • **dd** — Low-level data copying. `dd if=/dev/zero of=disk.img bs=1M count=100`.
  • **mkfs** — Create file systems. `sudo mkfs.ext4 /dev/sdb1`.
  • **parted** — Advanced partition manipulation.
  • Package Management

    Install, update, and remove software packages.

  • **apt update** — Update package lists.
  • **apt upgrade** — Upgrade all installed packages.
  • **apt install** — Install packages. `sudo apt install nmap`.
  • **apt remove** — Remove packages.
  • **apt search** — Search for packages. `apt search chromium`.
  • **dpkg** — Debian package manager. `dpkg -l` lists installed packages.
  • **snap** — Snap package manager. `snap install vlc`.
  • User Management

    Create and manage user accounts.

  • **useradd** — Create new users. `sudo useradd -m newuser`.
  • **usermod** — Modify user accounts. `sudo usermod -aG sudo newuser`.
  • **userdel** — Delete user accounts.
  • **passwd** — Change user passwords.
  • **id** — Display user identity and group memberships.
  • Compression and Archives

    Work with compressed files and archives.

  • **tar** — Archive files. `tar -czf archive.tar.gz directory` creates compressed archive.
  • **zip** — Create zip archives. `zip -r archive.zip directory`.
  • **unzip** — Extract zip archives.
  • **gzip** — Compress files with gzip.
  • **gunzip** — Decompress gzip files.
  • Tips for Mastering Linux Commands

  • **Use man pages**: Every command has a manual page. Type `man command` to read it.
  • **Practice daily**: Use the terminal for everyday tasks instead of graphical tools.
  • **Build scripts**: Start writing bash scripts to automate repetitive tasks.
  • **Learn pipes**: The pipe operator `|` chains commands together for powerful workflows.
  • **Use tab completion**: Press Tab to auto-complete commands and filenames.
  • For a complete reference of Linux commands with interactive examples, visit our [Linux Commands Reference](/linux-commands) page.

    Frequently Asked Questions

    What are the most essential Linux commands for beginners?

    Start with navigation (`pwd`, `ls`, `cd`), file operations (`cat`, `cp`, `mv`, `rm`), text processing (`grep`, `awk`, `sed`), permissions (`chmod`, `chown`), and networking (`ip`, `ping`, `netstat`).

    How do you find files in Linux?

    Use `find / -name 'filename'` for exact name searches, `find / -name '*.log'` for pattern matching, or `locate filename` for faster database-based searches (run `updatedb` first).

    What does chmod 755 mean?

    chmod 755 sets permissions: owner gets read/write/execute (7), group gets read/execute (5), others get read/execute (5). Common for scripts and executables. Use `chmod +x file` for quick executable permission.

    How do you search text in files with grep?

    Use `grep 'pattern' file` for basic search, `grep -r 'pattern' /path` for recursive directory search, and `grep -i 'pattern'` for case-insensitive matching. Combine with `-n` for line numbers.

    What is the difference between > and >> in Linux?

    The > operator overwrites the output file, while >> appends to it. For example, echo 'text' > file.txt replaces file contents, but echo 'text' >> file.txt adds to the end.

    How do you check running processes?

    Use `ps aux` for all processes, `top` or `htop` for real-time monitoring, and `pgrep -l name` to find specific processes. Use `kill PID` to terminate a process.

    How do you check disk space in Linux?

    Use `df -h` for filesystem disk usage in human-readable format, `du -sh /path` for directory sizes, and `lsblk` to list block devices and partitions.

    What is the difference between su and sudo?

    su switches to another user (e.g., `su - root`). sudo runs a single command as root (e.g., `sudo apt install nmap`). sudo is preferred as it doesn't require sharing the root password.