Linux Commands Cheat Sheet (original) (raw)

Last Updated : 13 Feb, 2026

Linux commands are text-based instructions entered in the terminal to interact with the operating system. They allow users to navigate the file system, manage files and processes, control system behavior, and automate tasks efficiently with precision and speed.

Linux commands are used for:

1. File Operations Commands

File operations commands are used to create, view, copy, move, compare, rename, and delete files in a Linux system. They help users efficiently manage file data and perform day-to-day file handling tasks from the command line.

2. Directory Operations Commands

Directory operations commands are used to navigate, list, create, search, and remove directories in a Linux file system. They help users organize files and manage directory structures efficiently from the command line.

3. File Permission and Ownership Commands

File permission and ownership commands are used to control access rights for files and directories by defining who can read, write, or execute them. They also allow administrators to change file ownership and group assignments to maintain system security.

4. User Management Commands

User management commands are used to create, modify, and delete user accounts in a Linux system. They help administrators manage user access, authentication, and account-related settings securely.

5. Group Management Commands

Group management commands are used to create, modify, and delete user groups in a Linux system. They help administrators control group-based permissions and manage multiple users efficiently.

6. Process Management Commands

Process management commands are used to monitor, control, and manage running processes. They help track system performance, control resource usage, and terminate or prioritize processes.

7. Networking Commands

Networking commands are used to configure, monitor, and troubleshoot network connections. They help manage IP addresses, test connectivity, transfer data, and analyze network performance.

8. Package Management Commands

Package management commands are used to install, update, upgrade, and remove software packages. They ensure proper dependency handling and keep the system up to date.

9. Job Scheduling Commands

Job scheduling commands are used to schedule tasks for future or recurring execution. They help automate routine system jobs like backups, updates, and maintenance.

10. Disk and File System Commands

Disk and file system commands are used to manage disks, partitions, and file systems. They help mount storage, check disk usage, and maintain data integrity.

11. Hardware and System Information Commands

These commands are used to display hardware details and system resource information. They help monitor CPU, memory, storage, and device-related data.

12. Compression and Archiving Commands

Compression and archiving commands are used to compress, extract, and manage archived files. They help reduce storage usage and simplify file transfer.

13. Text Processing and Formatting Commands

Text processing commands are used to search, filter, format, and manipulate text data. They are widely used for log analysis, scripting, and data processing.

14. Kernel and Module Management Commands

Kernel and module management commands are used to load, remove, and manage kernel modules and system services. They help control low-level system functionality.

15. System Control and Power Commands

System control commands are used to safely shut down, reboot, or power off the system. They help ensure proper system termination and data safety.

16. Logging and Monitoring Commands

Logging and monitoring commands are used to view system logs and track system activity. They help diagnose issues, analyze usage, and audit system behavior.

17. Checksum and File Integrity Commands

These commands are used to verify file integrity using hash values. They help detect file corruption or unauthorized changes.

18. Date and Time Commands

Date and time commands are used to display and manage system date, time, and uptime. They help with time synchronization and system monitoring.

19. Mail and User Communication Commands

Mail and communication commands are used for user messaging and system notifications. They help administrators communicate with users and manage mail queues.

Printing and media commands are used to manage audio, printing services, and media devices. They help control sound, printers, and removable media.

21. Shell Built-in and Scripting Commands

Shell built-in commands are used for scripting, automation, and flow control within the shell. They help write efficient scripts and control command execution.

Bash Shortcuts Commands:

Bash shortcut commands are keyboard combinations used in the Linux terminal to quickly perform common actions without typing full commands. They help users work faster and more efficiently by improving navigation, editing, and command execution.

1. Navigation Shortcuts

Used to move the cursor quickly within the command line.

2. Editing Shortcuts

Used to edit or modify the command line efficiently.

3. History Shortcuts

Used to search and navigate through previously executed commands.

22. Development and Build Automation Commands

Development commands are used to compile, build, debug, and analyze programs. They support software development and build automation processes.

23. Terminal and Session Management Commands

Terminal and session management commands are used to manage terminal sessions and input/output behavior. They help control multiple sessions and terminal settings.

24. Help and Documentation Commands

Help and documentation commands are used to view manuals, usage guides, and command descriptions. They assist users in learning and understanding Linux commands.

25. Text Editors in Linux

Text editors are used to create and modify files from the terminal.

**1. nano

nano is a simple and beginner-friendly text editor used in the terminal. It provides on-screen shortcuts, making it easy to edit files without prior experience.

**2. vi

vi is a powerful and lightweight text editor available on almost all Linux systems. It works in different modes, which allows efficient text editing using keyboard commands.

**3. vim

vim (Vi Improved) is an advanced version of vi with enhanced features like syntax highlighting and plugins. It is widely used by developers for fast and efficient coding.

**4. ed

ed is a line-based text editor and one of the oldest editors in Linux. It is mainly used for scripting and low-level text processing.

**5. emacs

emacs is a highly customizable and extensible text editor. It supports programming, scripting, email, and many other tasks beyond basic text editing.

Shortcuts Commands & Keys of Text Editors

There are many shortcuts commands in Linux that can help you be more productive. Here are a few of the most common ones:

1. Nano Shortcuts Commands:

File Operations

Used to open, save, and exit files.

Used to move through the file quickly.

Editing

Used to modify text efficiently.

Search and Replace

Used to find and replace text in a file.

2. VI/VIM Shortcuts Commands:

Insert & Replace Mode Commands

Used to enter insert mode or replace existing text.

Delete & Change Commands

Used to remove or modify text efficiently.

Undo & Restore Commands

Used to revert changes.

Case & Miscellaneous Commands

Used for quick character-level edits.

Mode Control

Used to switch between editing modes.

3. Vim Modes and Commands

Normal Mode

Used for navigation, deletion, copying, and undo/redo operations.

Command Mode (Last Line Mode)

Used for saving files, quitting Vim, and performing advanced operations.

Visual Mode

Used for selecting text to copy, delete, or modify.

26. IO Redirection Commands

IO (Input/Output) redirection commands are used to redirect the standard input, output, and error streams of commands and processes. Here are some commonly used IO redirection commands:

  1. **cmd < file : Redirects the input of cmd to be read from file instead of the keyboard.
  2. **cmd > file : Redirects the standard output (stdout) of cmd to file, overwriting existing content.
  3. **cmd >> file : Appends the standard output (stdout) of cmd to the end of file.
  4. **cmd 2> file : Redirects the error output (stderr) of cmd to file.
  5. **cmd 2>&1 : Redirects stderr to the same destination as stdout.
  6. **cmd &> file : Redirects both stdout and stderr to file.
  7. **cmd 1>&2 : Redirects stdout to the same destination as stderr.
  8. **cmd > /dev/null : Discards the standard output by sending it to the null device.
  9. **cmd1 <(cmd2) : Uses the output of cmd2 as an input file for cmd1 (process substitution).

27. Environment Variable Commands

Environment variables are used to store configuration settings, system information, and other variables that can be accessed by processes and shell scripts. Here are some commonly used environment variable commands:

**Note: Download the Linux Shortcut Cheatsheet from here.