Live, Learn, and Dream

A place to hold things that inspire, amaze, inform, and/or educate

Linux Cheat Sheet

I randomly came across this Linux Cheat Sheet.
For many beginners in Linux, this can be extremely helpful.
So far the document contains 550+ lines, and it is too long to copy everthing and paste it here, so I only post 100+ lines here. Go view the complete document at github if interested.

# (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.
# Best viewed in emacs org-mode.

* 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:

*** Command Line Utilities:
**** Basic File and Directory Operations:
# Print current working directory:

# Show files in current directory:

# 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. Be careful with this one. Can be destructive:

# Work with filesystems and partitions. (Easier, still quite dangerous):

**** System Administration:

# Execute command as an administrator (can be destructive/insecure. Use only for system administration tasks):
sudo command

# Become system administrator:
sudo -s

# Quit system administration:

***** Installing software from a .tgz (also known as a tarball):

# First, unzip the tarball (see section on tar, below)
# Next, move into unzipped directory:
cd software_directory

# Always read README first if it is provided, in case there are any modifications to the procedure outlined below:

# Automatically check for appropriate configurations and generate a MAKE file in the directory:

# Compile software. May require sudo:

# Move files into their appropriate locations. May also require sudo:
make install

# Clean up files in directory, in case make command fails, or just to remove unnecessary cruft:
make clean

***** Ubuntu/Debian Software repositories:

# 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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: