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:
Leave it to a proprietary software vendor to turn a cheap and easy parlor trick into a selling point. "Hey guys, why don't we turn our _collection of multiple files_ into a *collection of multiple files*!!" Extract the ^above with this:
cat pics.tar.gz.??? | tar xzv
^extract on any Unix - no need to install junkware!
(If you must make proprietary software, at least make it do something *new*)
if [ -e windows ]; then use 7-Zip
^Hexadecimal Ten minus Octal Ten is Eight(in Decimal).
echo "$(( 0xaf )) = $(( 0257 ))"
^Hexadecimal AF and Octal 257 are both Decimal 175.
To sort hidden files first, simply switch the two inner `ls` commands.
I have this aliased to `dira`
`dir` is aliased to the simpler version with no hidden files:
ls -l --color=always | less -R
This will get the job done in the most efficient way -
spawning only one `rm` process.
"On-the-fly" find data is displayed through `tee` and
you should have plenty of time to ctrl-c if needed before it's too late.
You may need to re-run this after major Software Updates.
To leave more languages in, add more ``-and \! -iname "lang*"'' statements:
sudo find / -iname "*.lproj" -and \! -iname "en*" -and \! -iname "spanish*" -print0 | tee /dev/stderr | sudo xargs -0 rm -rfv
**Edit: note the 2nd sudo near the end of the pipeline - this is necessary.
even when another instance is already open.
Great for testing purposes when you need
to be 2 people at once on the same site.
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.4 with Suhosin-Patch
and the ugly:
Server: Apache/2.2.10 (Win32) mod_ssl/2.2.10 OpenSSL/0.9.8i PHP/5.2.6
only for sudo-style systems.
Use this construct instead of I/O re-directors ``>'' or ``>>'' because
sudo only elevates the commands and *not* the re-directors.
***warning: remember that the `tee` command will clobber
file contents unless it is given the ``-a'' argument
Also, for extra security, the "left" command is still run unprivileged.
using `cat` under *NIX - just because you help manage M$ Windoze
*doesn't* mean you should have to resort to using it!
You can also make custom win32 installers with the 7zip "extras" package:
cat /path/to/7zSD.sfx /path/to/config.txt /path/to/archive > setup.exe
[re]verify those burned CD's early and often - better safe than sorry -
at a bare minimum you need the good old `dd` and `md5sum` commands,
but why not throw in a super "user-friendly" progress gauge with the `pv` command -
adjust the ``-s'' "size" argument to your needs - 700 MB in this case,
and capture that checksum in a "test.md5" file with `tee` - just in-case for near-future reference.
*uber-bonus* ability - positively identify those unlabeled mystery discs -
for extra credit, what disc was used for this sample output?