Tutorials : The Linux Command Line Cheat Sheet

 

Here is a clean, scannable Linux Command Line Cheat Sheet covering the essential commands you need for daily system administration, file management, and troubleshooting.


 

1. File & Directory Navigation

  • pwdPrint working directory (shows exactly where you are).

  • lsList directory contents.

    • ls -l — Long listing format (shows permissions, owner, size, and date).

    • ls -a — Show all files, including hidden ones (files starting with a dot .).

  • cd [directory]Change directory.

    • cd .. — Move up one directory level.

    • cd ~ — Go straight to your home directory.

2. File Operations (Create, Copy, Move, Delete)

  • touch [filename] — Create an empty file.

  • mkdir [dir_name]Make a new directory.

  • cp [source] [destination]Copy files.

    • cp -r [source_dir] [dest_dir] — Copy a directory recursively.

  • mv [source] [destination]Move or rename a file or directory.

  • rm [filename]Remove (delete) a file.

    • rm -r [dir_name] — Delete a directory and all its contents recursively.

    • ⚠️ Warning: rm deletes files permanently. There is no "Trash Bin" via the command line.

3. Viewing & Searching File Content

  • cat [filename] — Concatenate and display the entire contents of a file.

  • less [filename] — View a file page-by-page (press q to exit).

  • head -n [filename] — View the first n lines of a file.

  • tail -n [filename] — View the last n lines of a file (use tail -f to follow live log updates).

  • grep "[pattern]" [filename] — Search for a specific string or pattern inside a file.

4. Permissions & System Ownership

  • sudo [command] — Execute a command with administrative (superuser) privileges.

  • chmod [permissions] [filename]Change mode (modify read/write/execute permissions).

    • Example: chmod +x script.sh makes a script executable.

  • chown [user]:[group] [filename]Change owner and group of a file.

5. System Information & Process Management

  • df -h — Show disk free space in a human-readable format.

  • free -h — Display free and used memory (RAM).

  • top or htop — View active system processes in real-time (resource usage monitor).

  • ps aux — Snapshot of all running processes.

  • kill [PID] — Terminate a process using its Process ID.

6. Network Utilities

  • ping [host] — Send packets to a host (IP or domain) to check network connectivity.

  • curl [URL] — Fetch data from a URL (great for testing APIs or downloading files).

  • ip a — Show all network interfaces and assigned IP addresses.

Pro-Tips for Speed ⚡

ShortcutAction
TabAutocompletes commands, file names, and paths. Press twice to see all options.
Ctrl + CKills/stops the currently running terminal command.
Ctrl + LClears the terminal screen (same as typing clear).
historyDisplays a numbered list of all commands you've recently typed.

Read article and print from:  Linux Magazin June 2026 

Comments

Postari

Top 10 : Beyond Oil and Politics: The Rise of Free Software in Venezuela

Tutorials : The Ultimate Beginner’s Guide to Steam: How to Install, Find Free Games, and Start Playing

Top 10: Robotics firms globally, representing both layers in 2026

Top 10: Free Software Created in France

Tutorials : Clementine Music Player - The Ultimate Retro-Modern Audio Organizer