Problem: A site contains data which is of interest to us. The data is uniformly structured and available for examination by the general public (i.e. no login required) but is not automatically accessible, i.e. viewing it requires repetitive user interaction (such as setting a date range, clicking a ‘submit’ button, etc). In addition, usually the […]
grep
The linux ‘find’ command by example
find ~ -type f -name “.*” FIND the hidden files in your home directory (~) find . -name *~ -type f -delete Delete all files ending in ~ find . -name *.svn -type d -print0 | xargs -0 /bin/rm -rf Delete all .svn files under current dir find . -name *.c -perm /u+x -type f […]
RPM/yum : List (installed) packages versions (and grep ‘OR’)
Here’s how to list all packages whose names start with ‘nss’ yum info -v nss* | grep -v Committer | grep -w ‘Name\|Version\|Release\|Description\|Repo’ Here’s how to list all INSTALLED packages whose names start with ‘nss’ yum info -v nss* | grep -A12 -B5 -w ‘installed’ | grep -v Committer | grep -w ‘Name\|Version\|Release\|Description\|Repo\|installed’ And since […]
sed how-to: replace strings containing special charcters like . (dot) and / (slash)
I don’t know about the other people but to me the scariest UNIX command is by far sed. Today I found myself in a situation where I found no other way to solve my problem but to use sed… and it worked… and was not all that scary 🙂 I needed to replace a bunch […]
Make emacs grep/grep-find ignore .svn directories
Emacs grep and grep-find command used to work great for me until I started working with SVN and all those .svn directories started popping up in my emacs grep searches… So how can we make the emacs grep-find command ignore all the .svn directories? Being mostly a “git” guy, and having been recently introduced to […]