Commands by tebeka (7)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Remove apps with style: nuke it from orbit
You can't stand programs x, y, and z. Remove all trace of their existence by adding this function to your config. It will remove the cruft, the settings, and such and such. This function doesn't even give a damn about you trying to remove programs that don't exist: it'll just for loop to the next one on your hit list.

A command's package details
In Debian based distros, this command will list 'binutils' package details which contains 'nm' command. You can replace 'nm' to any other command.

list files recursively by size

Recursively replace a string in files with lines matching string
Changed out the for loop for an xargs. It's a tad shorter, and a tad cleaner.

Retrieve the size of a file on a server
Downloads the entire file, but http servers don't always provide the optional 'Content-Length:' header, and ftp/gopher/dict/etc servers don't provide a filesize header at all.

Print only the odd lines of a file
NR%2 == 1 on odd lines and 0 on even lines

Restore mysql database uncompressing on the fly.
This way you keep the file compressed saving disk space. Other way less optimal using named pipes: mysql -uroot -p'passwd' database <

Add .gitignore files to all empty directories recursively from your current directory

camelcase to underscore
For mac users !

Replace spaces in filename
This command will replace spaces in filename with underscore, for all file in directory that contain spaces.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: