commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
This one has a better performance, as it is a one pass count with awk. For this script it might not matter, but for others it is a good optiomization.
find ip address in all files in /etc directory. can be used to find any string in any directory really
Some computers these days don't have an HDD activity light, but they still have a useless caps-lock, so why not re-purpose that light to show HDD activity?
Requires setleds and dstat and probably needs to run as root.
make usable on OSX with filenames containing spaces. note: will still break if filenames contain newlines... possible, but who does that?!
The number on the far right is ratio of comments to code, expressed as a percentage. For the rest of the Yardstick documentation see https://github.com/calmh/yardstick/blob/master/README.md#reported-metrics
xargs is a more elegant approach to executing a command on find results then -exec as -exec is meant as a filtering flag.
Returns the version of the kernel module specified as "MODULENAME", when available.
`pwd` returns the current path
`grep -o` prints each slash on new line
perl generates the paths sequence: './.', './../.', ...
`readlink` canonicalizes paths (it makes the things more transparent)
`xargs -tn1` applies chmod for each of them. Each command applied is getting printed to STDERR.
This version also attaches to new processes forked by the parent apache process. That way you can trace all current and *future* apache processes.
completely remove those packages that leave files in debian / ubuntu marked with rc and not removed completely with traditional tools
This functionality seems to be missing from commands like dpkg. Ideally, I want to duplicate the behavior of rpm --verify, but it seems difficult to do this in one relatively short command pipeline.
Find all the occurrences in the git repo of 'foo' and replace with 'bar'