# cheat_sheet.org
# (C) William Hackmore, 2010
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License.
# Last updated 8/14/2012
# Best viewed in emacs org-mode.
* Command Reference:
** Basics:
*** Getting help:
# View the manual for target command
man [command]
# Get help with a target command (probably the same as above, but not always):
[command] -h
# In case you forget the name of a command, print possible commands relating to [guess]:
apropos [guess]
# View index of help pages:
info
*** Command Line Utilities:
**** Basic File and Directory Operations:
# Print current working directory:
pwd
# Show files in current directory:
ls
# Show maximum information about all files, including hidden:
ls -a
# Recurse into subdirectories and list those as well:
ls -r
# Move/rename a file or directory (be careful that you don't move the source over a destination with the same name):
mv [source] [destination]
# Delete target forever (be very careful), use -r recursive flag for directories:
rm [target]
# Copy file or directory:
cp [source] [destination]
# Mount filesytem:
mount /dev/[device name] /media/[device name]
# Unmount:
umount /media/[device name]
# Forensically clone filesystems and do other low-level operations on files. Very dangerous:
dd
# Work with filesystems and partitions. (Easier, still quite dangerous):
fdisk
**** System Administration:
# Execute command as an administrator (dangerous, but necessary for system administration tasks):
sudo [command]
# Become system administrator:
sudo -s
# Quit system administration:
exit
# Check distro repositories for software updates:
sudo apt-get update
# Download and install updates (update first):
sudo apt-get upgrade
# Search for package in the repositories:
apt-cache search [keyword]
# Get more detail on one specific package:
apt-cache show [package name]
# Download and install a package:
sudo apt-get install [package name]
# View the output of a command in a more convenient format:
[command] | less
**** Working With Files:
# Print a file in terminal:
cat
December 2019 | ||||||
---|---|---|---|---|---|---|
Su | Mo | Tu | We | Th | Fr | Sa |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |