100+ Essential Linux Commands for Every Linux User

Here's a categorized list of 100+ essential Linux commands every user should know, organized by functionality for quick reference.

Alby Andersen

File & Directory Management

  1. ls – List directory contents
    ls -l (detailed list), ls -a (show hidden files)
  1. cd – Change directory
    cd ~ (home), cd .. (up one level)
  1. pwd – Print working directory
  1. cp – Copy files/dirs
    cp -r (recursive for directories)
  1. mv – Move/rename files
  1. rm – Remove files
    rm -rf (force delete dirs – use cautiously!)
  1. mkdir – Create directory
    mkdir -p (create nested dirs)
  1. rmdir – Remove empty directory
  1. touch – Create empty file/update timestamps
  1. cat – Display file content
    cat > file.txt (create file)
  1. nano/vim – Text editors
  2. less/more – View files page-by-page
  1. head – Show first 10 lines of a file
    head -n 20 (show 20 lines)
  1. tail – Show last 10 lines
    tail -f (follow log updates)
  1. ln – Create links
    ln -s (symbolic link)
  2. find – Search files/dirs
    find / -name "*.log"
  1. locate – Find files quickly (uses database)
  1. chmod – Change permissions
    chmod 755 file, chmod +x script.sh
  2. chown – Change ownership
    chown user:group file
  1. stat – Show file details

System Information

  1. uname – System info
    uname -a (all details)
  2. df – Disk space
    df -h (human-readable)
  1. du – Directory space usage
    du -sh /dir
  1. top/htop – Real-time process monitor
  1. free – Memory usage
    free -m (MB units)
  2. uptime – System uptime
  3. whoami – Current user
  4. hostname – System hostname
  5. lscpu – CPU information
  6. lsblk – List block devices

Process Management

  1. ps – List processes
    ps aux (detailed list)
  1. kill – Terminate process
    kill -9 PID (force kill)
  1. killall – Kill processes by name
    killall nginx
  2. bg – Send process to background
  3. fg – Bring process to foreground
  4. jobs – List background jobs
  5. nice – Set process priority
  6. renice – Change priority of running process
  7. pkill – Kill processes by pattern
  8. pgrep – Find PIDs by name

Networking

  1. ping – Test connectivity
    ping google.com
  2. ifconfig/ip – Network interfaces (use ip for modern systems)
  1. netstat – Network stats
    netstat -tulpn (open ports)
  2. ss – Socket statistics (replaces netstat)
  3. dig/nslookup – DNS queries
  4. traceroute – Network path tracing
  5. wget – Download files
    wget -c (resume download)
  1. curl – Transfer data via URLs
    curl -O file_url
  1. ssh – Remote login
    ssh user@host
  2. scp – Secure file copy
    scp file.txt user@host:/path
  3. rsync – Sync files
    rsync -avz source/ dest/
  4. iptables – Firewall rules
  5. nmcli – NetworkManager CLI tool
  6. host – DNS lookup
  1. whois – Domain registration info

User & Permission Management

  1. sudo – Execute as superuser
  2. su – Switch user
    su - username
  3. useradd – Add user
    useradd -m johndoe
  4. passwd – Change password
  5. usermod – Modify user
    usermod -aG sudo johndoe
  6. userdel – Delete user
  7. groupadd – Create group
  8. id – User/group info
  9. visudo – Edit sudoers file
  10. last – Show login history

Package Management

  1. apt – Debian/Ubuntu packages
    apt install package
  2. yum – RHEL/CentOS (older)
  3. dnf – RHEL/CentOS (modern)
  4. pacman – Arch Linux
    pacman -S package
  5. zypper – openSUSE
  6. snap – Universal packages
    snap install package
  7. dpkg – Debian package installer
    dpkg -i package.deb
  8. rpm – RPM package manager

Text Processing

  1. grep – Search text patterns
    grep -i "error" log.txt (case-insensitive)
  1. sed – Stream editor
    sed 's/old/new/g' file.txt
  2. awk – Text processing language
    awk '{print $1}' file.txt
  3. cut – Extract columns
    cut -d',' -f1 data.csv
  1. sort – Sort lines
    sort -nr (numeric reverse)
  1. uniq – Remove duplicates
    uniq -c (count repeats)
  1. wc – Word/line count
    wc -l file.txt
  2. diff – Compare files
    diff file1.txt file2.txt
  3. tr – Translate characters
    tr 'a-z' 'A-Z'
  4. tee – Redirect to file and screen
    ls | tee output.txt

Compression/Archiving

  1. tar – Archive files
    tar -czvf archive.tar.gz /dir
  1. gzip/gunzip – Compress/decompress .gz files
  1. zip/unzip – .zip archives
  2. bzip2/bunzip2 – .bz2 compression
  3. 7z – 7-Zip utility

Disk Management

  1. fdisk – Partition disks
  1. mount/umount – Attach/detach filesystems
  2. lsusb/lspci – List hardware devices
  3. mkfs – Format disk
    mkfs.ext4 /dev/sdb1
  4. fsck – Filesystem check
  5. dd – Disk/image operations
    dd if=/dev/sda of=backup.img

Terminal Management

  1. clear – Clear terminal
  1. history – Command history
    !123 (rerun command #123)
  2. alias – Create shortcuts
    alias ll='ls -alF'
  3. source – Reload configs
    source ~/.bashrc
  4. exit – Close terminal
  5. tmux/screen – Terminal multiplexers

Scripting & Automation

  1. cron – Schedule tasks
    Edit with crontab -e
  2. at – Run command once at a time
  1. echo – Print text
    echo $PATH
  1. printf – Formatted output
  2. test – Conditional checks
    Used in scripts: if test -f file.txt; then...

Advanced Tools

  1. strace – Trace system calls
  2. lsof – List open files
    lsof -i :80
  3. journalctl – Systemd logs
    journalctl -u nginx
  4. systemctl – Manage services
    systemctl start nginx
  5. vmstat – Virtual memory stats
  6. iostat – Disk I/O stats
  7. sar – System activity reporter
  8. nc/netcat – Network Swiss Army knife
  9. tcpdump – Network packet capture
  10. openssl – SSL/TLS toolkit

Pro Tips

  • Use man command (e.g., man ls) to read manuals.
  • Combine commands with pipes: cat file.txt | grep "error" | sort
  • Redirect output: > (overwrite), >> (append), 2> (stderr).
  • Wildcards: * (any chars), ? (single char), [a-z] (ranges).

Practice these in a safe environment first! Commands like rm -rf / or dd can cause irreversible data loss.

Share This Article