-
Dinky pocketbooks: the command-line reference edition
I have fulfilled my intention from to create a dinky pocket book as a reference for useful terminal commands (see below). I'll be printing a set of these out for my colleagues to find on their desks next week.
The printable pdf can be found here, but if you are running safari — or a recent gecko build as now it also uses
-moz-transform— you can print directly from the browser.The HTML for the reference booklet together with some minor updates to the original booklet css can be found on github.
I rarely use the terminal so these are commands that I will find useful as a reference and some of these I always end up having to look up. It is not designed to be an exhaustive list but if you have any suggestions I would love to hear them!

Navigate the file tree
changing directory to
dirnamecd dirnamemove up a directory in the tree—dont forget you can drag a folder in from the finder to get a path to that directory.
cd ..go back to the last directory I was in
cd -where am I? (present working directory)
pwdlist what's in this directory
lsnow give me more information in the listing
ls -lahssh to server
ssh user@domain.comFind & open
list all files recursively in subdomains
find .find all files with '
.css' in the namefind . | grep .cssfind the string '
prose' in the contents of all the files in this directorygrep -r "prose" .open a file as if you had double clicked it in the finder (mac only)
open filenameopen the current directory in the finder
open .make a directory called
dirnamemkdir dirnamecreate a file called
filenameif it doesnt exist or update last modified date if it doestouch filenameMove, remove & copy
move or rename a file or directory
mv oldname newnameremove a file
rm filenameremove a directory and all its contents. BE VERY CAREFUL! you could easily delete everything!
rm -rf dirnamecopy a file
cp oldfilename newfilenamecopy a directory and everything in it
cp -r olddirname newdirnamesecurely copy a file to / on a remote server — you can also copy a directory using
scp -rscp file user@domain.com:Subversion
check out a repository to the current directory
svn co http://domain.com/svn/ .update local directory from repository
svn upare there new or modified files?
svn statusadd new files to the repository
svn add filenameremove a file from subversion
svn remove filenamemark a previously conflicted file as resolved
svn resolved filenamewho changed what line number of this file
svn blame filenamecommit all changes in this directory
svn commit -m "commit msg"Subversion & download
is this directory checked out from svn? and where?
svn infoshow everything that has changed
svn diffshow what has changed in one file
svn diff filenameopen text editor in order to specify which files to ignore from svn
svn propedit svn:ignore .download a file to the current directory
wget URLshow the contents of a file in the terminal
curl URLHelp & information
run any command as root
sudo your-command-hereget help for any command, eg
svnsvn --helphow long has this computer been on?
uptimewhat is the size of the current directory and all the contents
du -hcancel the command you were currently typing
ctrl + cgo to the beginning of the line in the terminal
ctrl + ago to the end of the line in the terminal
ctrl + e
1 item tagged "gecko"
Look at "gecko" on del.icio.us, Flickr or Technorati
