Archive for the ‘Linux’ Category

Command line goodies

Wednesday, July 8th, 2009

Here are some command line tidbits that i use regularly and find to be very handy, hopefully you will too.

Create a list of files in a directory and all its subdirectories
find [path] -type f > [output file]
example for listing all files in the directory source:
find source -type f > files.txt

Monitor cpu usage
top -F -ocpu -s 5 -n 5

Update Modification Date Recursively
find {dir} -exec touch {} \;

backup a directory
rsync -av –delete [src] [dest]

search through your command line history
history | grep -i “search string”
this will output a list of history commands by history number that match your search, then use the history number to run that command again
![history number]

remove all .svn directories
find ./ -name “.svn” | xargs rm -Rf

Mounting Windows shares on Linux

Wednesday, February 11th, 2009

Recently I had the need to back up my svn repositories root directory that lives on our Linux dev server to a Windows server. At first I tried to mount an NFS Windows share to my Linux box, but because we don’t have an NIS server I am not able to authenticate my Linux account against my Windows account. Most of you developers out there that have to support yourselves will probably have this issue because most office IT infrastructures are Windows based which don’t always play nice with your Linux dev box. The answer to this wasn’t as straight forward as you might think, so I thought that I would share my solution.
(more…)