Comment Various useful commands I use daily. (Score 1) 2362
Here's some very handy commands. I use most, if not all, of these on a regular basis.
$ namei -m
f:
drwxr-xr-x /
drwxr-xr-x var
drwxr-xr-x log
drwxr-xr-x httpd
-rw-r--r-- error.log
Substitute a string in a variable in bash.
$ version="6.4.4-5"
$ echo ${version%%-[0-9]*}
6.4.4
Exclude all the
find $1 -name '.svn' -prune -o -print | xargs grep -l "$2"
Perl oneliner to convert an epoch to the current date/time.
perl -le 'print scalar(localtime("1223234245"))'
I also started doing a lot of work in Ruby last year after hearing about, and deploying at the company I worked for, a configuration management tool called Puppet. Along with Ruby scripting, I've come to love two excellent tools: rake and capistrano. The quick version, rake is a "make" for Ruby. It will execute shell commands and can do all kinds of awesome. Capistrano was originally written to aid in deploying Rails applications on multiple systems, and has also become a sort of glorified "ssh for loop" since it uses Ruby's Net::SSH class.