commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Alias to produce a list of all subdir sizes in current dir, in reverse order and human readable units. du is executed only once. Remove the slash after the asterisk to include files.
Apply to almost linux distroes.
Returns any file in the folder which would be rejected by Gmail, if you were to send zipped version.
(Yes, you could just zip it and knock the extension off and put it back on the other side, but for some people this just isn't a solution)
Get the IP of a hostname.
Just a few minor changes.
First the usage of lynx instead of curl so no sed is needed to revert the spaces. Then the usages of egrep instead of grep -e to save a few characters and last the removal of the extra 0.
Useful for grepping an IP range from the maillog. When for instance dealing with a spam-run from a specific IP range, or when errors occur from or to a specific IP-range.
In the example above the IP range 22.214.171.124/10 (126.96.36.199 - 188.8.131.52)
To grep the IP range 184.108.40.206/19 (220.127.116.11 - 18.104.22.168) from the maillog:
egrep '124\.217\.2(2[4-9]|[0-9]|5[0-5])' -J /var/log/maillog*
NOTE: the location of the maillog may vary based upon operating system and distribution.
Just an alternative :)
Somtime one wants to kill process not by name of executable, but by a parameter name. In such cases killall is not suitable method.
searches through the linux dictionary for the word you're trying to spell (you can use regular expressions, e.g. "< /usr/share/dict/words egrep bro[c]+o[l]+i" )
Really, you deserve whatever happens if you have a whitespace character in a file name, but this has a small safety net. The truly paranoid will use '-i'.
I have this as a file called deletekey in my ~/bin.
Makes life a little easier.
Quicker way to search man pages of command for key word
This should do the same thing and is about 70 chars shorter.
Requires aria2c but could just as easily wget or anything else.
A great way to build up a nice font collection for Gimp without having to waste a lot of time. :-)
If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server.
This shows you which files are most in need of commenting (one line of output per file)
I created this command to give me a quick overview of how many file types a directory, and all its subdirectories, contains. It works based off file extension, rather than file(1)'s magic output, because it ended up being more accurate and less confusing.
Files that don't have an ext (README) are generally not important for me to want to count, but you're free to customize this fit your needs.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.