The best thing about using Macs as a development tool is that they are UNIX based.
fritz digital developer and producer, london +44 (0)7817 719 566
Category: UNIX and the shell
Posts
Finding files inside an archive with Terminal
Lots of searching with this current project… this time looking for files inside an archive, without having to extract them first. Using Apple’s Terminal, or any Unix / Linux bash shell: [script lang="bash"]find /dir/ -iname archive.tar -print0 | xargs -0 tar t -f | grep “filename you are searching for”
find /dir/ -iname archive.zip -print0 | xargs -0 unzip -l | grep “filename you are searching for”
find /dir/ -iname archive.rar -print0 | xargs -0 unrar l | grep “filename you are searching for”
[/script]
More»
Finding recently changed files with Terminal
To list files that were changed in the last day, sorted by size, using Apple’s Terminal, or any Unix / Linux bash shell: sudo find / -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr(thanks mynamewasgone!)
More»
Copying files matching a pattern, preserving directory structure, with cpio
How to copy files matching a pattern to a different directory preserving the folder structure. For example, you want to duplicate a directory within a version controlled project, and need to ignore all the .svn folders. More»
Batch unrar from the command line on Mac OS X
Rar is a popular archive format on the web. When I need to unarchive several rar files at once, I use RarLab’s command line tool. Here’s how.
More»
Setting A Bash Prompt in OS X
To change the command line prompt on bash, my shell of choice, you need to edit the file .bash_profile in your home directory. To do that, UNIX machos will tell you to use vi. This I find only slightly less painful than walking on my knees on dried chickpeas, and I won’t touch it (I won’t even touch vim, its marginally less awkward cousin). More»
Finding files on the command line and doing something with them
This will unzip all files from a_directory into another_directory
find a_directory -iname "*.zip" -exec unzip -d another_directory {} \;
This add all image files inside a_directory to CVS as binary.
find a_directory -iname '*.gif' -or -iname '*.jpg' -exec cvs add -kb {} \;
Sub-categories
- Parent
- Geekery
- Siblings
- Applications and Tools /10
Microsoft / Windows /1
OS X /8
Web Development /10 - Children
- None

Updates
subscribe to this blog's rss feed'
follow me on twitter
subscribe friendfeed
my delicious bookmarks
my youtube channel