three years 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
nice article, thanks for sharing this whit us!
if you want to buy<a href="http://www.jerseysusa.com">replica nfl jerseys</a>, just find me on my website..
replica jerseys 10th August 2010 05:01
thanks, I'll keep this in mind.
Resume Help 10th August 2010 08:50
Edward 10th August 2010 12:48
Hello dear bloggers! Very glad to come to your blog, here is a very nice place! If you have friends interested in Microsoft products, you can click here to http://www.wholesale-key.com/ this would be a good choice!
windows code 11th August 2010 09:36
Can anything be more simple? Thanks! :)
Ephedrine Products 13th August 2010 12:48
What a remarkable experience you get to manage this.. I wish I could be one of the team..
Shoulder Bags 13th August 2010 14:22
Acuvue Advance Astigmatism 15th August 2010 06:37
Hopkins 16th August 2010 08:23
Hayward 16th August 2010 08:23
Smith 16th August 2010 08:24
Roobs 16th August 2010 08:28
The beauty of these blogging engines and CMS platforms is the lack of limitations and ease of manipulation that allows developers to implement rich content and 'skin' the site in such a way that with very little effort one would never notice what it is making the site tick all without limiting content and effectiveness.
Technology Update 16th August 2010 13:10
above ground pool liner 18th August 2010 10:33
This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I really would want...HaHa). You definitely put a new spin on a subject thats been written about for years. Great stuff, just great!
free windows 7 wallpaper 19th August 2010 07:29
What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.
Fast Food Obesity 20th August 2010 07:09
thanks for shared
this is a great articles
Auto manual repair 20th August 2010 14:50
David R 21st August 2010 09:37
Louis Vuitton Artsy 22nd August 2010 12:05
louis vuitton 22nd August 2010 13:32
dgdfghsfs
wwe 23rd August 2010 04:28
fghfhhfghf
qvod 23rd August 2010 04:29
dui lawyer miami 23rd August 2010 13:45
Car Reviews 25th August 2010 10:13
dollar items 26th August 2010 09:58
Let me start by saying nice post. Im not sure if it has been talked about, but when using Chrome I can never get the entire site to load without refreshing many times. Could just be my computer. Thanks.
Considerably, this post is really the sweetest on this notable topic. I harmonise with your conclusions and will thirstily look forward to your incoming updates. Saying thanks will not just be sufficient, for the phenomenal clarity in your writing. I will directly grab your rss feed to stay informed of any updates. Admirable work and much success in your business dealings! Please excuse my poor English as it is not my first tongue.
Business News 26th August 2010 12:35
movie blog 27th August 2010 07:36
john 27th August 2010 11:28
Peter 27th August 2010 11:29
johnson 27th August 2010 11:29
Danny 27th August 2010 11:30
JeremyNath 28th August 2010 07:44
Thanks for this great information.
Mesothelioma Information 29th August 2010 02:04
It's so refreshing to find articles like the ones you post on your site. Very informative .
http://www.2mesotheliomainfo.blogspot.com
About Mesothelioma 29th August 2010 02:37
computer news 30th August 2010 03:31
Discount Wholesale Electronics, Wholesale Cell Phones, Electronic Gadgets and More from the Best Dropship Wholesaler
Wholesale Electronics 30th August 2010 07:34
nba wallpaper 30th August 2010 21:58
marryholmes 31st August 2010 08:07
PayingAdspot 31st August 2010 13:12
Infant Milestones 1st September 2010 04:34
acne treatment 2nd September 2010 08:49
For newbie like me, Dinky pocketbooks: the command-line reference edition is really new stuff for me. I will follow the next step of this stuff. Keep on sharing your great thinking.
Sincerely yours,
<a href="http://www.laptop-computer-s.com/nokia-n96-smartphone-unlocked-gsmchina-version">nokia n96</a>
Arnie Wartz 2nd September 2010 11:16
I hope you have a nice day! Very good article, well written and very thought out. I am looking forward to reading more of your posts in the future.
http://www.juicycouture4u.com/
Juicy Couture 3rd September 2010 03:38
Londo 3rd September 2010 12:43
Neopets 4th September 2010 04:33
carpet cleaning service 4th September 2010 06:55
antique classic cars 4th September 2010 08:45
news and trends portal 5th September 2010 07:02
college scholarship 5th September 2010 14:25
forex auto pilot 6th September 2010 19:27
options trading system 6th September 2010 19:30
Hot News Today 7th September 2010 07:27
user manual 8th September 2010 10:09
Nice one.
MafiaBoy 8th September 2010 10:51
Bisnis Syariah 8th September 2010 18:49
leather recliners 9th September 2010 05:35
Great article. Code is easy to follow. Cheers for your work.
spread betting firms 9th September 2010 07:02
nannan 9th September 2010 07:44
adjustable bed frame 10th September 2010 02:29
Beautiful piece of work, thoroughly enjoyed it. Looking forward to more
Rolex replica 10th September 2010 05:40
rolex watches replica 10th September 2010 08:18
san diego wrongful death attorney 10th September 2010 11:10
Al principio, yo preferiría decir gracias a ustedes por este artículo informativo. Segundo, tuve prefieren interrogar a donde puedo conseguir mayor información sobre su artículo. Acabo de llegar aquí a través de Yahoo y no puede comprobar cualquier otro sitio web correspondiente sobre este tema. ¿Qué debo hacer
signo de su blog web? Tuve prefieren unirse a las actualizaciones a medida que llegan a lo largo de! Tuve una consulta para interrogar, pero he olvidado lo que era absolutamente ... de todos modos, gracias. Muy buen ejemplo. Gracias por el artículo informativo. woow, esta es la verdad! "¡Hey! Esto no se ve muy bien. Vamos a un proxeneta de diseño hasta las interfaces! "Buen artículo;) Este es el blog perfecto para cualquier persona que quiera saber acerca de este tema. Sabes mucho de su casi difícil de discutir con usted (no es que yo realmente quiero ... jaja). Usted definitivamente dar un <a title="Watch TV On Laptop" href="http://www.watch-tv-on-laptop.org">Watch TV On Laptop</a>nuevo giro sobre un tema thats sido escrito por años. Gran cosa, simplemente genial!
andy 11th September 2010 18:28
http://www.watch-tv-on-laptop.org/
<a href="http://www.watch-tv-on-laptop.org">Watch TV On Laptop</a>
Es posible que no tenía intención de hacerlo, pero creo que se las han arreglado para expresar el estado de cuenta que muchas personas están dados: la sensación de querer ayudar, pero sin saber cómo ni dónde, es algo que muchos de nosotros son pasando. Esto es realmente una buena lectura para mí, hay que reconocer que usted es uno de los mejores bloggers que he saw.Thanks por publicar este artículo informativo.
amazon.kindle 11th September 2010 18:32
You may have not intended to do so, but I think you have managed to express the state of mind that a lot of people are in. The sense of wanting to help, but not knowing how or where, is something a lot of us are going through. This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.<a href="http://www.watch-tv-on-laptop.org">Watch TV On Laptop</a>Thanks for posting this informative article.
Andria 11th September 2010 18:41
Let me start by saying nice post. Im not sure if it has been talked about, but when using Chrome I can never get the entire site to load without refreshing many times. Could just be my computer. Thanks.
Considerably, this post is really the sweetest on this notable topic. I harmonise with your conclusions and will thirstily look forward to your incoming updates. Saying thanks will not just be sufficient, for the phenomenal clarity in your writing. I will directly grab your rss feed to stay informed of any updates. <a href="http://www.sales-trainingcourses.com/">sales training courses</a> Admirable work and much success in your business dealings! Please excuse my poor English as it is not my first tongue.
Andria 11th September 2010 18:45