File Operations
ls List directory contents cd Change directory pwd Print name of current/working directory touch Change file timestamps cp Copy files and directories mv Move or rename files rm Remove files or directories find Search for files in a directory hierarchy cat Concatenate and print files less View file content with backward navigation file Determine file type
Directory Operations
mkdir Make directories rmdir Remove empty directories
Text Processing
more File perusal filter for viewing head Output the first part of files tail Output the last part of files sort Sort lines in text files nl Number lines of files wc Print newline, word, and byte counts for each file grep Print lines matching a pattern sed Stream editor for filtering and transforming text awk Pattern scanning and processing language
File Permissions
chmod Change file modes or Access Control Lists chown Change file owner and group chgrp Change group ownership
Process Management
ps Report a snapshot of the current processes top Display Linux tasks htop Interactive process viewer bg Run jobs in the background fg Run jobs in the foreground kill Send a signal to a process
Network Operations
ping Send ICMP ECHO_REQUEST to network hosts netstat Network statistics ss Socket statistics ssh OpenSSH SSH client scp Secure copy (remote file copy program) sftp Secure file transfer program wget The non-interactive network downloader curl Transfer a URL nslookup Query Internet name servers interactively ifconfig Configure a network interface traceroute Print the route packets trace to network host telnet User interface to the TELNET protocol
System Information
uname Print system information hostname Show or set the system’s host name dmesg Print or control the kernel ring buffer df Report file system disk space usage du Estimate file and directory space usage free Display amount of free and used memory in the system uptime Tell how long the system has been running w Show who is logged on and what they are doing who Show who is logged on whoami Print the user name associated with the current effective user ID lsblk List block devices (also see Disk Space Tools & Usage) lsusb List USB devices lscpu Display information about the CPU architecture lspci List all PCI devices
Package Management
apt APT package handling utility (Debian-based systems) yum Interactive, rpm based, package manager (Red Hat-based systems) dnf Dandified YUM (Fedora) zypper Command line package management (openSUSE) pacman Package manager utility (Arch Linux)
File Compression and Archives
tar An archiving utility gzip Compress or expand files gunzip Compress or expand files zip Package and compress (archive) files unzip List, test and extract compressed files in a ZIP archive bzip2 A block-sorting file compressor xz Compress or decompress .xz and .lzma files
Disk Usage
fdisk Manipulate disk partition table (also see Disk Space Tools & Usage) mkfs Build a Linux filesystem fsck Check and repair a Linux filesystem dd Convert and copy a file hdparm Get/set SATA/IDE device parameters
System Control
reboot Reboot the system shutdown Bring the system down halt Halt the system init Upstart process management daemon systemctl Control the systemd system and service manager
Text Editors
nano Nano’s ANOther editor, an enhanced free Pico clone vi Screen-oriented (visual) display editor vim Vi IMproved, a programmer’s text editor emacs GNU project Emacs text editor
Shell Built-ins
echo Display a line of text exit Cause the shell to exit history Command History export Set an environment variable unset Unset values and attributes of shell variables and functions alias Define or display aliases unalias Remove alias definitions
Environment Variables
env Run a program in a modified environment set Set or unset values of shell options and positional parameters printenv Print all or part of environment
Pipes and Redirection
| (pipe) Pipe stream to another command %3E Redirect output %3C Redirect input >> Append to file 2> Redirect standard error &> Redirect both standard output and standard error tee Read from standard input and write to standard output and files
Others
date Display or set date and time cal Display a calendar bc An arbitrary precision calculator language expr Evaluate expressions cut Remove sections from each line of files
Search and Discovery
apropos Search the manual page names and descriptions for a given keyword. find Search for files in a directory hierarchy locate Find files by name grep Print lines matching a pattern egrep Print lines matching a pattern (extended) fgrep Print lines matching a pattern (fixed) rgrep Recursive grep, search directories recursively ack A tool like grep, optimized for programmers ag (the_silver_searcher) A code-searching tool similar to ack, but faster rg (ripgrep) Recursively searches directories for a regex pattern which Shows the full path of shell commands whereis Locate the binary, source, and manual page files for a command type Indicate how a name would be interpreted if used as a command name lsmod Show the status of modules in the Linux Kernel lsof List open files pstree Display a tree of processes ps Report a snapshot of the current processes top Display Linux tasks htop Interactive process viewer df Report file system disk space usage (also see Disk Space Tools & Usage) du Estimate file and directory space usage (also see Disk Space Tools & Usage) free Display amount of free and used memory in the system uptime Tell how long the system has been running uname Print system information id Print real and effective user and group IDs who Show who is logged on whoami Print the user name associated with the current effective user ID last Show listing of last logged in users netstat Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships ss Another utility to investigate sockets ip Show / manipulate routing, devices, policy routing and tunnels ifconfig Display or configure a network interface iwconfig Display or change wireless network settings traceroute Print the route packets trace to a network host dig DNS lookup utility nslookup Query Internet name servers interactively host DNS lookup utility nmap Network exploration tool and security / port scanner
For Windows Command Line Cheat Sheet For PowerShell cmdlets Cheat Sheet For Wireshark-Cheat-Sheet.pdf