# Show the manual for commandmancommand# Show the history of the commands executedhistory# Uses the bang (!) to refer to the id of the command in history!<history_number>
# Repeat the last command executed!!
# Delete all output and restart consolereset
# Show the output of a command in a table formatcommand|column-t
# Stack of directories to save navigationpushd/path/file
popd/path/file
File commands
# Formatted listing with hidden filesls-la
# Change directory to dircd# Change directory to homecdcd~
# Back to previous directorycd-
# Create a directory dirmkdirdir
# Force remove directory dirrm-rfdir
# Copy dir1 to dir2cp-rdir1dir2
# Rename/move file1 to file2mvfile1file2
# Create symbolic link to fileln-sfilelink
# Create or update filetouchfile
# Place standard input into filecat>file
# Output the cotents of filemorefile
# Output the first lines of fileheadfile
# Output the last lines of filetailfile
# Output the contents of file as it grows, starting with the last 10 linestail-ffile
# Set the size of the file to 0, so it delets all of its contenttruncate-s0file
# Count words/lines in a filewc
File Permissions
# Change the mode of access `chmod OPTIONS {u,g,o}{+,-,=}{r,w,x}`# User (u), Group (g), Others (o)# Read (r,4), Write (w, 2), Execute (x, 1) chmod777file
chmodu=rwxfilename
chmod-r+xfile
# change the file owner and/or groupchownowner:groupfile
chown-rowner:groupfile
Process Management
# Display your currently active processesps
# Display all running processestop
htop
# Kill process id PIDkill<PID>
# Kill al processes named prockillallproc
# "Minimaze" send to the backgroundctrl+z
# List stopped or background jobs; resume a stopped job in the backgroundbg# Brings the most revent job to foregroundfg# Brings job n to the foregroun fgn
# Run a command immune to hangups, even when the parent terminal is closednohupcommand# Process starts in the backgroundcommand&# Process starts in the background and the process will not be killed when closing the terminalnohupcommand&
SSH
# Connect to host as usersshuser@host
# Connect to host on port as userssh-pportuser@host
# Add your key to host for user to enable a keyed or passwordless loginssh-copy-iduser@host
# Copies files between hosts on a networkscpadm-dumitrux@10.0.0.10:/home/adm-dumitrux/dumitrux@10.0.0.20:/home/dumitrux
# Copies files between hosts on a network; selects the private key for authenticationscpadm-dumitrux@10.0.0.10:/home/adm-dumitrux/dumitrux@10.0.0.20:/home/dumitrux-i~/.ssh/mytest.key
Searching
# Search for pattern in filesgreppatternfiles
# Search recursively for pattern in dirgrep-rpatterndir
# Search for pattern in the output of commandcommand|greppattern
# Find all instances of filelocatefile
System info
# Show the current date and timedate
# Show this month's calendarcal
# Show current uptimeuptimw
# Display who is onlinew
# Who you are loggin in aswhoami
# Display information about userfingeruser
# Show kernel informationuname-o
# CPU informationcat/proc/cpuinfo
# Memory informationcat/proc/meminfo
# Show disk usagedf
# Show directory space usagedu
# Estimate file space usage; sc: display only a total; h: human readable formatdu-sch|sort-h
# Show memory and swap usagefree
# Show possible locations of appwhereisapp
# Show which app will be run by defaultwhichapp
Network
# Ping host and output resultspinghost
# Get whois info for domainwhoisdomain
# Download filewgetfile
# DNS lookup utilitydiggoogle.com
diggoogle.com@dns_ip
# Print the route packets trace to network hosttraceroute-4google.com
# Query Internet name servers interactivelynslookupgoogle.com
Compression
# Create a file.tar containing filestarcffile.tarfiles
# Extract the files from file.tartarxffile.tar
# Create a tar using gziptarczffile.tar.gzfiles
# Extract a tar using gzip with verbose outputtarxzfvfile.tar.gz
Miscellany
# Edit the user session bash to add the date on the history commands outputvim~/.bashrc
>HISTTIMEFORMAT="%T-%m-%d %T "# Not useful, just looks coolcmatrix