Helpful Unix and Mac commands

I am for the most part a Windows user. I was kind of moving towards Linux, Ubuntu in particular, but that ship pretty much sailed when I got my hands on Windows 7. Awesome, awesome operating system. But, I still have to use some Unix and Mac systems once in a while. And then there are certain commands that I often use, but always forget since it usually goes a bit of time between times I do it. So, what follows is basically just a list of commands that I keep forgetting, but keep having to look up again.

Remove .DS_Store files

Removes all those stupidannoying DS_Store files that Mac litters around wherever it goes. Works in the current directory and downwards.

find . -name *DS_Store -exec rm {} \;

Recursivly download a whole website

wget -T 5 -t 0 -m -np -w 5 --random-wait -E -k -p -P output/dir http://website

Compress and decompress files

# Compress
tar czvf archive.tar.gz filedir filedir
tar cjvf archive.tar.bz2 filedir filedir

# Decompress
tar xzvf archive.tar.gz
tar xjvf archive.tar.bz2

Find open files

lsof filename

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>