cd
change directorycd <directory>
changes to directorycd ..
parent directorycd ../..
two directories up
~
alias to home directorytouch
updates or changes file modification time. Creates file if it doesn’t exist.touch -c <file>
prevents creation of file only updates
ls
– list contents of the current directoryls -la
shows hidden files tools -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
-lists contents with permissions in octal format
*2^(8-i));if(k)printf("%0o ",k);print}'
pwd
show the current (working) directory’s pathcp
copyscp
secure copycat
output file contentsgzip
– a compression programgunzip
– a decompression programfind
– search for filesmysql
– connect to a MySQL servermysqldump
– “dump” from a MySQL server|
“pipe” output to another program>
output to a file<
input from a filegrep
regular expressionsrm
remove / delete (be careful on this one)<command> --help
many programs have a built-in “help” to show you basic usage informationman <command>
“manual” program to show information on how to use a commandchmod 755 <file>
gives full permissions to a filehost myip.opendns.com resolver1.opendns.com
– returns your current IP addressnano ~/.bash_profile
to edit the .bash_profilesource ~/.bash_profile
to save changes
This is a conglomeration of several online cheatsheets, the origins of which are noted in the resources section below. It also includes my own notes, any of this is open for discussion. Please feel free to correct any wrong information or to include any which are vital but may have been overlooked.