Skip to content

Instantly share code, notes, and snippets.

@raineorshine
Created March 31, 2014 18:03
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save raineorshine/9898350 to your computer and use it in GitHub Desktop.
Save raineorshine/9898350 to your computer and use it in GitHub Desktop.
Bash Cheat Sheet: Just the Essentials (13 Commands). See https://gist.github.com/6927510 for more.
man COMMAND # Look up help for the given command
pwd # Print working directory
cd MYDIR # Change directory to MYDIR
cd ~/ # Change directory to user root (/Users/USERNAME)
cd .. # Change directory up a level
mkdir NEWDIR # Create a new directory in the current folder called NEWDIR
cp FROM_FILE TO_FOLDER # Copy FROM_FILE into TO_FOLDER
cp -r FROM_DIR TO_FOLDER # Copy FROM_DIR into TO_FOLDER
mv FROM_FILE TO_FOLDER # Move FROM_FILE into TO_FOLDER
mv -r FROM_DIR TO_FOLDER # Move FROM_DIR into TO_FOLDER
touch NEWFILE # Create a new file (or update the timestamp of a file that exists)
rm MYFILE # Delete MYFILE
rm -rf MYDIR # Delete MYDIR and all its contents. Careful!
less MYFILE # View a file in the less program. Type 'space' to scroll and
# 'q' to quit.
type COMMAND # Get the type of a shell command or executable. Great for
# seeing if a command exists.
open MYFILE # Open a file with the default application for that filetype
open MYFILE -a "Google\ Chrome" # Open a file with the named application"
# shortcuts
ctrl + c # Kill current process
ctrl + d # EOF (End-of-File). Often used to end stdin.
@geparkton
Copy link

this is really starting to look scary !

@geparkton
Copy link

hi,i've created a terminal acc. but i'm not sure as to whats next. There is many options for the next step and after reviewing the inst. videos i'd like to have the same set up but i guess you just have to experiment until you can find it or what works.And whats this about attaching files and drag or drop and pasting from the clip board. I haven't been able to copy and paste yet that it worked right . what i'm finding out is you cant just paste to your browser or to any spot ya want on your page either. yea i'm having loads of fun. Break time, i have to go and cast my vote,,,,,HAVE YOU.!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment