Getting git status on multiple directories

At any given time, I have a handful of git repositories that I work on. While typing in the command-line is great, it getting tiring when you have a several directories that you have to manually change to and check. The “git status” command can take the git repo and the working directory as input. That, and a little bash programming to the rescue. The following command, executes git status in every subdirectory that is a git repository. ...

March 31, 2014 · 1 min · Shivanand Velmurugan

Working with rpms (extract, list contents)

Unix. I love thee! Extract an rpm without installing in to the current directory (really, the rpm command should support this): $ rpm2cpio myrpmfile.rpm | cpio -idmv *i: Restore archive *d: Create leading directories where needed *m: Retain previous file modification times when creating files *v: Verbose i.e. display progress List contents of an rpm: $ rpm -qlp myrpmfile.rpm source

February 17, 2013 · 1 min · Shivanand Velmurugan

More unix goodness

Ohh the unix command prompt, I love thee! Can you guess what these commands do? 1 2 # grep -l <regex> # find . -name <regex> -delete

May 21, 2012 · 1 min · Shivanand Velmurugan

Unix: removing duplicates from a file

Over the last few months, I have re-discovered some unix commands (it’s been such a long time) Eliminate duplicate lines from a file #sort -u filename > filename.new List all lines that do not match a condition #grep -v ajsk filename Copy contents of two files to one #cat file1 file2 > file3 Append output of a command to a file #cat file1 >> file2

September 9, 2008 · 1 min · Shivanand Velmurugan