one year agoDinky 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 dirname
cd dirname
move 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)
pwd
list what's in this directory
ls
now give me more information in the listing
ls -lah
ssh to server
ssh user@domain.com
Find & open
list all files recursively in subdomains
find .
find all files with '.css' in the name
find . | grep .css
find the string 'prose' in the contents of all the files in this directory
grep -r "prose" .
open a file as if you had double clicked it in the finder (mac only)
open filename
open the current directory in the finder
open .
make a directory called dirname
mkdir dirname
create a file called filename if it doesnt exist or update last modified date if it does
touch filename
Move, remove & copy
move or rename a file or directory
mv oldname newname
remove a file
rm filename
remove a directory and all its contents. BE VERY CAREFUL! you could easily delete everything!
rm -rf dirname
copy a file
cp oldfilename newfilename
copy a directory and everything in it
cp -r olddirname newdirname
securely copy a file to / on a remote server — you can also copy a directory using scp -r
scp 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 up
are there new or modified files?
svn status
add new files to the repository
svn add filename
remove a file from subversion
svn remove filename
mark a previously conflicted file as resolved
svn resolved filename
who changed what line number of this file
svn blame filename
commit all changes in this directory
svn commit -m "commit msg"
Subversion & download
is this directory checked out from svn? and where?
svn info
show everything that has changed
svn diff
show what has changed in one file
svn diff filename
open text editor in order to specify which files to ignore from svn
svn propedit svn:ignore .
download a file to the current directory
wget URL
show the contents of a file in the terminal
curl URL
Help & information
run any command as root
sudo your-command-here
get help for any command, eg svn
svn --help
how long has this computer been on?
uptime
what is the size of the current directory and all the contents
du -h
cancel the command you were currently typing
ctrl + c
go to the beginning of the line in the terminal
ctrl + a
go to the end of the line in the terminal
ctrl + e

Peteris Krumins 24th May 2009 08:35
find . -type f -exec grep -l ".css" {}\;This is an example of find giving you back a filename that has ".css" in it. It's also important to note that exec can execute pretty much any command.
find . -type f -exec mycommand {}\;Note: {} is going to be the filename of the file it currently is on. Also the backslash is required.
J 24th May 2009 14:38
Brilliant job !!
I really love your practical css3 trick !
Satoshi Kikuchi 1st June 2009 17:04
can't but admire the way you do things:) it looks so simple in your performance. hope I'll also succeed in trying this.
Mhunter 20th May 2010 07:04
can't but admire the way you do things:) it looks so simple in your performance. hope I'll also succeed in trying this.
Papaz Büyüsü 2nd June 2010 16:34
Jim D 15th June 2010 17:10
Thanks for great reference editing, I think I will write about it in my <a href="http://www.customwritings.com">essay</a> in university.
Jim D 15th June 2010 17:12
Pump in style advanced 25th June 2010 09:57
find . -type f -exec mycommand {}\;
Note: {} is going to be the filename of the file it currently is on. Also the backslash is required.
club penguin cheats
ClubPenguin 25th June 2010 10:39
hope I'll also succeed in trying this.
batterie 27th June 2010 13:15
Thanks for great reference editing
labatterie 27th June 2010 13:15
Your post is really informative for me. I liked it very much.
blanc pain watch 10th July 2010 09:44
camera lens cheap 13th July 2010 02:56
women's winter boots 13th July 2010 03:37
alexis 13th July 2010 11:43
Link Building Service 13th July 2010 14:54
overhead dvd players 14th July 2010 14:26
Home design ideas 14th July 2010 19:03
free music download mp3 15th July 2010 10:01
jaibreak iphone 15th July 2010 13:52
How To Flirt Girls 15th July 2010 16:10
Business Innovation 15th July 2010 18:52
I can see that you are putting a lots of efforts into your blog. Keep posting the good work.Some really helpful information in there. Bookmarked. Nice to see your site. Thanks!
Always Health and Beauty 16th July 2010 04:39
Great post! I?m just starting out in community management/marketing media and trying to learn how to do it well - resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case
Health Lifesyle 16th July 2010 08:42
I must admit that this is one great insight. It surely gives a company the opportunity to get in on the ground floor and really take part in creating something special and tailored to their needs.
Radar7 News 17th July 2010 04:08
Supplements and Vitamins Articles 17th July 2010 17:45
Home Based Business Articles 19th July 2010 08:00
Great post! I?m just starting out in community management/marketing media and trying to learn how to do it well - resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case
Mesothelioma 19th July 2010 16:15
jessie 21st July 2010 08:19
Also the backslash is required.
Rolex watches 22nd July 2010 07:35
This was the first place that told me the answer.
r4 ds 22nd July 2010 07:36
essay help 22nd July 2010 23:52
dissertation help 22nd July 2010 23:53
Great post! I?m just starting out in community management/marketing media and trying to learn how to do it well - resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case
Health World 25th July 2010 08:21
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.
Micro Trend Security 25th July 2010 12:22
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.
Micro Trend Security 25th July 2010 12:23
I must admit that this is one great insight. It surely gives a company the opportunity to get in on the ground floor and really take part in creating something special and tailored to their needs.
Fashion Blog 26th July 2010 12:47
Your blog is very informative.This is obviously one great post.i keep on reading articles from here.thanks for sharing.
Replica Watches 26th July 2010 17:47
I am following your blog regularly and got great information. I really like the tips you have given.
philadelphia security systems 28th July 2010 07:53