Keyboard Shortcuts: Terminal Tabs
| Windows Shortcuts | macOS Shortcuts | Name | Description |
|---|---|---|---|
| Creating and Closing Tabs | |||
| Ctrl + ⇧Shift + T | ⌘Cmd + T | New Tab | Opens a new tab in the current terminal window. Allows working with multiple sessions in one window, which is more convenient than opening many windows. |
| Ctrl + ⇧Shift + W / Ctrl + D | ⌘Cmd + W | Close Tab | Closes the current tab. If it is the last tab in the window, the entire terminal window closes. |
| Ctrl + ⇧Shift + N | — | New Window | Opens a new terminal window, copying the current session (tab) to the new window. |
| Tab Navigation | |||
| Ctrl + PgDn | Ctrl + PgDn | Next Tab | Switches to the next tab (located to the right of the current one). Similar to tab switching in a browser. |
| Ctrl + PgUp | Ctrl + PgUp | Previous Tab | Switches to the previous tab (located to the left of the current one). Allows quick navigation between open sessions. |
| Ctrl + ⇧Shift + PgDn | — | Move Tab Right | Moves the current tab one position to the right in the tab bar. Useful for reorganizing the session order. |
| Ctrl + ⇧Shift + PgUp | — | Move Tab Left | Moves the current tab one position to the left in the tab bar. Allows organizing tabs by logical order. |
| Alt + 1–9 | — | Jump to Tab by Number | Instantly jumps to a tab by its sequential number (1 to 10). The fastest way to access a specific session without sequential switching. |
Keyboard Shortcuts: Navigation
| Windows Shortcuts | macOS Shortcuts | Name | Description |
|---|---|---|---|
| Copying and Undo | |||
| Ctrl + ⇧Shift + C | ⌘Cmd + C | Copy | Copies selected text to the system clipboard. In Linux terminal (GNOME Terminal) this combination is used instead of the standard Ctrl+C, which interrupts the process. |
| Ctrl + ⇧Shift + V | ⌘Cmd + V | Paste | Pastes the contents of the system clipboard at the current cursor position in the terminal. Useful for pasting long paths and commands without typing. |
| Ctrl + C | Ctrl + C | Interrupt Command | Sends SIGINT signal to the currently running process, interrupting its execution. Clears the current input line. One of the most used combinations. |
| Search | |||
| Ctrl + ⇧Shift + F | ⌘Cmd + F | Text Search | Opens a built-in search window in the terminal. Allows searching text across all terminal output, including regular expressions. Indispensable when working with large amounts of command output. |
| Line Movement | |||
| Ctrl + A | Ctrl + A | Start of Line | Instantly moves the cursor to the beginning of the current input line. An alternative to pressing the left arrow multiple times. Useful when working with long commands. |
| Ctrl + E | Ctrl + E | End of Line | Instantly moves the cursor to the end of the current input line. An alternative to pressing the right arrow multiple times. Allows quickly returning to the right edge to extend a command. |
| Word and Character Movement | |||
| Ctrl + F | Ctrl + F | Move 1 Character Right | Moves the cursor one character forward (right). Similar to the right arrow key. Works within readline — Bash's line editing library. |
| Ctrl + B | Ctrl + B | Move 1 Character Left | Moves the cursor one character backward (left). Similar to the left arrow key. Used by readline for navigation in the command line. |
| Alt + F | ⌥Option + F | Next Word | Moves the cursor to the beginning of the next word. Effective when navigating long paths or commands with many parameters. Works at the Bash token level. |
| Alt + B | ⌥Option + B | Previous Word | Moves the cursor to the beginning of the previous word. Useful for navigating command parameters without character-by-character navigation. |
Keyboard Shortcuts: Process Management
| Windows Shortcuts | macOS Shortcuts | Name | Description |
|---|---|---|---|
| Pause and Resume | |||
| Ctrl + Z | Ctrl + Z | Suspend Process | Stops the current process execution and places it in the background tasks list. The process continues running and using resources, but returns the command prompt. Useful for subsequent management via fg/bg/jobs. |
| Output Stop | |||
| Ctrl + S | Ctrl + S | Stop Output | Temporarily stops terminal output updates. The process continues running, but the screen stops updating. Useful when quickly scrolling through a data stream without stopping it. |
| Ctrl + Q | Ctrl + Q | Resume Output | Resumes the output paused by Ctrl+S. Restores the display of output data in the terminal. Also known as XON/XOFF flow control. |
Keyboard Shortcuts: Command History
| Windows Shortcuts | macOS Shortcuts | Name | Description |
|---|---|---|---|
| Interactive History Search | |||
| Ctrl + R | Ctrl + R | Reverse Search | Enables interactive search through command history. Start typing part of a command — Bash will find the first match. Press Ctrl+R again to cycle through matches. Enter to execute, Esc to cancel. |
| Ctrl + 0 | Ctrl + 0 | Execute Found Command | Immediately executes the command found via Ctrl+R without additional confirmation or editing. The input field is cleared after execution. |
| Ctrl + G | Ctrl + G | Exit Search | Exits command history search without executing the found result. Returns to the normal command prompt. |
| Alt + R | ⌥Option + R | Undo History Changes | In history search mode: undoes all edits to the found command, restoring it to its original form from history. |
| History Navigation with Arrows | |||
| Ctrl + ↑Up | Ctrl + ↑Up | Previous Command | Analogous to the up arrow: shows the previous (earlier) command from history. Can be pressed repeatedly to go deeper into history. |
| Ctrl + ↓Down | Ctrl + ↓Down | Next Command | Analogous to the down arrow: shows the next (later) command from history. Works in pair with Ctrl+P for navigating history up and down. |
| Ctrl + P | Ctrl + P | Previous (analog of up) | Alternative way to call the previous command (Page Up / Previous). Works analogous to the up arrow in Bash readline. Indispensable when working on servers without a physical keyboard with arrow keys. |
| Ctrl + N | Ctrl + N | Next (analog of down) | Alternative way to call the next command (Page Down / Next). Works in pair with Ctrl+P. Also analogous to Ctrl+J and Ctrl+M. |
| Ctrl + M / Ctrl + J | Ctrl + M / Ctrl + J | Analog of Enter | Alternative keys for confirming input (Enter). Equivalent to pressing Enter. Used in software input processing for compatibility of different systems. |
Keyboard Shortcuts: Command Editing
| Windows Shortcuts | macOS Shortcuts | Name | Description |
|---|---|---|---|
| Text Deletion | |||
| Ctrl + U | Ctrl + U | Delete to Start of Line | Cuts all text to the left of the cursor into the Bash clipboard. The text is not deleted, but copied — it can be pasted back via Ctrl+Y. A powerful tool for quickly clearing the beginning of a line. |
| Ctrl + K | Ctrl + K | Delete to End of Line | Cuts all text to the right of the cursor into the Bash clipboard. Similar to Ctrl+U, but in the opposite direction. Useful for quickly deleting the end of a long command. |
| Ctrl + W | Ctrl + W | Delete Word Left | Cuts one word (or parameter) to the left of the cursor into the Bash clipboard. Works at the word level, separated by spaces. Indispensable for deleting incorrectly entered parameters. |
| Ctrl + D | Ctrl + D | Delete Character (Del) | Deletes the character under the cursor forward (analogous to the Delete key). If the line is empty, closes the current terminal session (analogous to the exit/EOF command). |
| Ctrl + H | Ctrl + H | Delete Previous Character (Backspace) | Deletes the character before the cursor (analogous to the Backspace key). Works the same as the standard backspace delete key. Used by readline instead of system processing. |
| Alt + D | ⌥Option + D | Delete to Next Space | Deletes all text from the cursor to the nearest space to the right. Useful for quickly deleting command parameters separated by spaces. |
| Alt + ⌫Backspace | ⌥Option + ⌫Backspace | Delete to Previous Space | Deletes all text from the cursor to the nearest space to the left. An alternative to multiple Ctrl+W for deleting words in a row. |
| Word Movement | |||
| Alt + T | ⌥Option + T | Swap with Previous Word | Swaps the current word with the previous one. Useful for correcting the order of command parameters without rewriting them. |
| Esc + T | Esc + T | Swap Two Previous Words | Swaps the last two words before the cursor. An alternative way to correct word order via the Escape key. |
| ⇥Tab | ⇥Tab | Autocomplete | Automatically completes a command or path based on entered characters. Double Tab shows all possible options. The foundation of effective terminal work. |
| Ctrl + T | Ctrl + T | Swap Two Characters | Swaps two adjacent characters around the cursor. Useful for correcting a typo (e.g., «selectle» → «selectel»). The command is also known as transposition. |
| Bash Clipboard | |||
| Ctrl + Y | Ctrl + Y | Paste from Bash Clipboard | Pastes text from the internal Bash clipboard (text cut via Ctrl+U, Ctrl+K, Ctrl+Y). Works independently of the system clipboard. Allows quickly returning deleted text to the line. |
Commands: Command History
| Command | Name | Description |
|---|---|---|
| history | Display Command History | Displays the full list of previously executed commands with their sequential numbers. Commands are stored in RAM during the session and in ~/.bash_history after closing the terminal. |
| history | grep |
Refined History Search | Filters command history by the specified substring. Allows finding a specific command among hundreds of previous ones when you only remember part of its name or parameters. |
| !151 | Execute by Number | Re-executes the command with the specified number from history. For example, !151 will execute the 151st command from history. Useful for re-running specific commands without searching for them. |
| !151: | Display by Number | Displays the command with the specified number from history, but does NOT execute it. Allows checking the contents before re-running. The colon at the end disables automatic execution. |
| !! | Repeat Last Command | Instantly repeats the last executed command. One of the most frequently used techniques. Often used as sudo !! to re-run the previous command with superuser privileges. |
Commands: Navigation and Help
| Command | Name | Description |
|---|---|---|
| Command Chaining | ||
| command1 && command2 | Chain (AND list) | Executes command2 only if command1 completed successfully (exit code 0). Used to create conditional action chains, e.g.: mkdir -p dir && cd dir. |
| Aliases | ||
| alias name=command | Create Alias | Assigns a short name to a long command. Allows creating custom shortcuts for frequently used commands. For example: alias ll='ls -la'. Aliases are saved in ~/.bashrc. |
| Help | ||
| man |
Manual Page | Opens the built-in manual for a command with a full description of syntax, flags, options, and usage examples. The most complete source of information for any installed Linux command. |
| whatis |
Brief Description | Displays a one-line description of a command from the manual pages database. A quick way to understand the purpose of an unknown command without opening the full manual. |
| Command Help | Displays brief help for a command with main flags and parameters. Works for most GNU utilities. A more compact alternative to man for quick overview. | |
| clear | Clear Screen | Clears the visible area of the terminal of all previous messages. Output remains in the buffer and is available via scroll. Alternative: Ctrl+L. |
| date | Date and Time | Displays the current system date and time. Useful in console scenarios and when working without a graphical shell. Supports formatting via arguments. |
Commands: Superuser Privileges
| Command | Name | Description |
|---|---|---|
| sudo |
Privileged Access | Executes a command as the superuser (root). Prompts for the current user's password. Used for commands requiring elevated privileges. Password is entered invisibly (no characters shown). |
| sudo su | Root Session | Switches to an interactive superuser session. All subsequent commands are executed as root until the terminal is closed. Use with caution — mistakes can damage the system. |
| sudo gksudo |
GUI with Root Privileges | Launches a graphical application with superuser privileges. For example: sudo gksudo nautilus to open a file manager with full access to system files. |
| sudo !! | Repeat with sudo | Re-executes the last executed command with sudo added. Useful when you forgot to run a command with root privileges. Substitutes the result of the last command as an argument. |
Commands: Package Manager
| Command | Name | Description |
|---|---|---|
| Debian/Ubuntu (apt) | ||
| sudo apt update | Update Cache | Updates the local package database from remote repositories. Must be performed before installing or updating to get the latest package versions. |
| sudo apt upgrade | Update Packages | Installs all available updates for already installed packages. Executed after apt update. May require confirmation. Recommended for system security. |
| sudo apt install |
Install Package | Installs the specified package from the repository. Automatically resolves dependencies. For multiple packages — list them separated by spaces: apt install pkg1 pkg2. |
| sudo apt remove |
Remove Package | Removes the specified package, but keeps configuration files. To remove with configuration, use purge instead of remove. |
| sudo apt purge |
Remove with Configs | Full removal of the package along with all configuration files and dependencies. Used for complete removal of unwanted software. |
| sudo apt autoremove | Auto-Remove | Removes all orphaned and unused packages. Frees disk space by removing packages that were installed as dependencies and are no longer needed. |
| sudo apt-add-repository |
Add Repository | Adds a third-party package repository to the sources list. Allows installing packages from external sources (PPA in Ubuntu). |
| Fedora/RHEL (dnf) | ||
| sudo dnf install |
Install Package | Installs a package via the DNF manager, used in Fedora, Red Hat, and CentOS. Analog of apt install. |
| sudo dnf config-manager --add-repo |
Add Repository | Adds a third-party repository in DNF. Allows installing packages from external sources on Fedora/RHEL systems. |
| sudo dnf upgrade | Update System | Updates all installed packages in the system to the latest versions. Analog of apt upgrade for DNF. |
| sudo dnf remove |
Remove Package | Removes the specified package from the system. Analog of apt remove for DNF. |
| sudo dnf autoremove | Auto-Remove | Removes all unused dependencies. Analog of apt autoremove. |
| Arch/Manjaro (pacman) | ||
| sudo pacman -S |
Install Package | Installs a package via Pacman — the package manager for Arch Linux and Manjaro. Analog of apt install and dnf install. |
| sudo yaourt -S |
Install from AUR | Installs a package from AUR (Arch User Repository) if it is not in the main repository. Allows installing community software. |
| sudo pacman -Sy | Update Cache | Updates information about available packages. Analog of apt update for Arch Linux. |
| sudo pacman -Syu | Full Update | Updates all system packages to the latest versions. Synchronizes the cache and performs a full system update. |
| sudo pacman -R |
Remove Package | Removes the specified package without dependencies. Analog of apt remove. |
| sudo pacman -Rs |
Remove with Dependencies | Removes the package along with all installed dependencies that are no longer needed. Used for complete software removal. |
Commands: Processes
| Command | Name | Description |
|---|---|---|
| ps aux | List Processes | Shows all running processes with PID, CPU and memory usage. Flags: a (all processes), u (user information), x (without terminal). A basic diagnostic tool. |
| top | Process Monitor | Interactive real-time process viewing with sorting by CPU consumption. Press q to exit. Allows dynamically managing processes during operation. |
| htop | Improved Monitor | An extended version of top with a colorful interface, interactive management, and graphs. Installed separately: sudo apt install htop or sudo dnf install htop. |
| jobs | Background Tasks | Displays a list of suspended (via Ctrl+Z) and background processes of the current session. Useful before restoring processes via fg or bg. |
| kill |
Terminate Process | Force-terminates a process with the specified PID. By default sends SIGTERM signal (graceful termination). For forced termination: kill -9 |
| killall |
Kill by Name | Terminates all processes with the specified name. For example: killall firefox will terminate all Firefox instances. Works at the process name level. |
| xkill | Kill Graphical Window | Interactive termination of a graphical application. After launching, the cursor changes shape — click on a window to close it. Only works in a graphical environment. |
| bg | Background Execution | Resumes a suspended process in the background with return of the command prompt. The process continues running in parallel. |
| fg | Bring to Foreground | Resumes a suspended process in the foreground with capture of the command prompt. The process gains interactive control. |
Commands: Files and Folders
| Command | Name | Description |
|---|---|---|
| Viewing and Creating | ||
| ls -la | List Files | Shows all files (including hidden with .) with detailed information: permissions, owner, size, modification date. -l (long format), -a (all files). |
| pwd | Current Directory | Outputs the full path to the current working directory. Useful when navigating through nested directories. |
| cd |
Change Directory | Navigates to the specified directory. Uses absolute (/home/user) or relative (./dir, ../dir) paths. cd - returns to the previous directory. |
| mkdir |
Create Folder | Creates a new directory with the specified name. mkdir -p creates nested directories without errors: mkdir -p a/b/c. |
| cat |
View File | Outputs the contents of a text file to the terminal. With multiple files — concatenates them. cat file1 > newfile combines contents. |
| tail -f |
Real-Time Logs | Continuously outputs newly added lines in a file. Indispensable for monitoring application and web server logs without restarting the command. |
| File Management | ||
| rm -rf |
Delete File/Folder | Recursively deletes a file or directory. -r (recursive), -f (without confirmation). Dangerous — deletion is irreversible. Use with caution. |
| cp -r |
Copy | Copies a file or directory (with -r for nested). Creates an exact copy of the contents in a new location. |
| mv |
Move / Rename | Moves a file to another directory or renames it. If the destination is a name in the same directory, the file is renamed. |
| file |
File Type | Determines the file type (text, image, archive, etc.) regardless of extension. Useful for files without extensions. |
| touch |
Create / Update | Creates an empty file or updates the last access/modification date of an existing one. Useful for creating templates and triggers. |
| nano |
Text Editor | Opens a simple built-in text editor. Creates a new file or opens an existing one for editing. Save: Ctrl+O, Exit: Ctrl+X. |
| rename |
Bulk Rename | Renames one or multiple files according to a given rule. Supports masks and regular expressions for bulk operations. |
| tar -cvf archive.tar files | Archive | Creates a tar archive. tar -xvf archive.tar extracts the contents. The standard archiving format in Linux without compression. |
| zip -r9 |
Zip Compression | Creates a ZIP archive with maximum compression level. Packs all files and subdirectories from the specified directory. |
Commands: Disks and Partitions
| Command | Name | Description |
|---|---|---|
| lsblk | List Block Devices | Displays all block devices (disks, partitions, USB) in a tree format. Shows names (sda, sda1) and partition structure. |
| mount |
Mount | Connects a filesystem to the specified mount point. Works with disks, USB, partitions, and ISO images. Requires superuser privileges. |
| umount |
Unmount | Safely unmounts a mounted filesystem. Use before ejecting USB or external drives. |
| dd if=input of=output bs=4M | Copy / Clone | Bit-by-bit copying of disks/files. if (input file) — source, of (output file) — destination. bs (block size) — block size for speed. Use with caution — can irreversibly erase data. |
Commands: System
| Command | Name | Description |
|---|---|---|
| df -h | Disk Usage | Shows the amount of free and used space on all mounted partitions. Flag -h (human-readable) formats sizes in KB, MB, GB. |
| free -h | RAM Usage | Displays the amount of used and free RAM. Flag -h for readable format. Includes swap space. |
| uname -a | System Information | Outputs complete information about the OS kernel: name, version, hostname, architecture. Useful for diagnostics and gathering system information. |
| uptime | Uptime | Shows how long the system has been running since the last boot, number of users, and average load over 1, 5, 15 minutes. |
| whoami | Current User | Outputs the name of the current user. Useful when working via SSH or if you forgot which login you are connected with. |
| whereis |
Command Location | Shows full paths to the executable file, manual pages, and source code of the specified program. |
| reboot | Reboot | Reboots the system. Analogous to shutdown -r now. Requires superuser privileges. |
| shutdown -h now | Shutdown Now | Properly shuts down the system. -h (halt) — stop. After completion, you can disconnect the power. |
| shutdown -h +10 | Shutdown in Time | Scheduled shutdown after the specified number of minutes. Allows delaying shutdown with the ability to cancel. |
| shutdown -r 20:00 | Schedule Reboot | Schedule a reboot at the specified time (in 24-hour format). Useful for updating the system during off-hours. |
| shutdown -c | Cancel Shutdown | Cancels a previously scheduled shutdown or reboot operation. |
| lsb_release -a | Distribution Version | Shows complete information about the Linux distribution: name, version, codename. Useful when working with various systems. |
Commands: Users
| Command | Name | Description |
|---|---|---|
| useradd |
Create User | Registers a new user in the system and creates their home directory. Requires superuser privileges. |
| userdel |
Delete User | Deletes the user account and files from the system. userdel -r also deletes the home directory. |
| usermod |
Modify Parameters | Changes account settings: home directory, groups, lock date. Requires superuser privileges. |
| passwd |
Change Password | Changes the account password. Regular user — their own, root — any. Requires entering the current and new password. |
Commands: Network
| Command | Name | Description |
|---|---|---|
| ip address show | Network Addresses | Displays all network interfaces and their IP addresses. ip a — shortened form. Alternative to ifconfig. |
| ip route | Routing | Shows the routing table: how packets are directed to various networks. Useful for diagnosing network issues. |
| ip link set ethX up/down | Enable / Disable Interface | Enables (up) or disables (down) the ethX network interface. Programmatic management of network connections. |
| ping | Connectivity Check | Checks the availability of a remote host via ICMP echo requests. Shows latency and packet loss. Ctrl+C to stop. |
| ifconfig | Network Interfaces | Displays IP address, MAC address, and parameters of network interfaces. A classic command, partially replaced by ip. |
| ssh user@host | SSH Connection | Establishes an encrypted SSH connection to a remote server. Requires configured access on the remote machine. The foundation of administration. |
| scp file.txt user@remote:/path | SCP File Transfer | Copies files between the local system and a remote server via SSH protocol. A secure alternative to FTP. |
| wget https://example.com/file.zip | Download File | Downloads a file from the internet via the specified URL to the home directory. Supports download resumption and background work. |
| curl https://api.example.com | HTTP Request | Sends HTTP/HTTPS requests to servers. Indispensable for testing APIs, checking headers, and debugging web services. |
Commands: Fun
| Command | Name | Description |
|---|---|---|
| cowsay |
Chatty Cow | Displays an ASCII art cow that "says" the specified text. A fun utility for the terminal. |
| fortune | cowsay | Smart Cow | Shows a random quote or aphorism in the cow's "mouth". A combination of fortune and cowsay via pipe (|). |
| cowsay -l | List Characters | Displays a list of all available characters (animals) for cowsay. You can replace the cow with a dragon, cat, and others. |
| cowsay -f dragon |
Dragon with Text | Shows a breath-fire dragon instead of a cow. -f sets the character. |
| sudo apt-get install fortunes fortune-mod fortunes-min fortunes-ru | Russian Quotes | Installs a Russian-language quote package for fortune. After installation, cowsay will quote in Russian. |