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:
Recursively rename .JPG to .jpg using standard find and mv. It's generally better to use a standard tool if doing so is not much more difficult.
This command will set bash as the default shell for all users in a FreeBSD system.
There's no need for ls or grep; printf is builtin to most modern shells
Calculates the size on disk for each package installed on the filesystem (or removed but not purged). This is missing the
| sort -rn
which would put the biggest packges on top. That was purposely left out as the command is slightly on the slow side
Also you may need to run this as root as some files can only be checked by du if you can read them ;)
Display man page in plain text
Sends both stdout and stderr to the pipe which captures the data in the file 'out.test' and sends to stdout of tee (likely /dev/tty unless redirected). Works on Bourne, Korn and Bash shells.
* in bash-shell You can capture the current commandline to a text-editor:
* simply press: CTRL+x+e
* Your current commandline will pe put into Your default text-editor (export EDITOR=vim)
Simple command to convert a large number of images into jpeg-format. Will delete originals after conversion.
I used this because I needed to sort the content of a bunch of gzipped log files. Replace sort with something else, or simply remove sort to just rezip everything
Display commands and their arguments as they are executed. Useful for debugging shell scripts.
In the sample output, I pressed ctrl+r and typed the letters las. I can't imagine how much typing this has saved me.