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:
Go to begin of the current command line.
Add dirs to list:
you should choose proper color to make comments invisible.
This is a bit to bit copy so if you have a 500GB hard disk it will take a long time even if have Gigabit Ethernet
There's no need for ls or grep; printf is builtin to most modern shells
Numbers are less understandable then words. Also this may put out a different result.
Doesn't use shuf, its much faster with "shuf -n4" instead of sort -R
This is a better way to do the "src X or dst X" filter; plus you might not want to bother with DNS lookups (-n).
Opens the current working directory in the user's preferred application using freedesktop.org's xdg-open.
The same command, but with a base64 filter, more forgiving for special characters than tr.
How to show the system properties of a Sun VirtualBox server
Wgets "whatismyip" from checkip.dyndns.org and filters out the actual IP-adress. Usefull when you quickly need to find the outward facting IP-address of your current location.
First column is number of photos, second column is the focal length.
For debian and ubuntu :
sudo apt-get install pdfcrack
xargs is a more elegant approach to executing a command on find results then -exec as -exec is meant as a filtering flag.
With this command you can use shell variables inside sed scripts.
This is useful if the script MUST remain in an external file, otherwise you can simply use an inline -e argument to sed.
Easy way to find your computers IP in one place, ie, twitter
It suppress the need of dyndns clients and remembering the complex names they give you.
I put it inside KAlarm ( the cron GUI for KDE, ubuntu), to update my ip every 3 minutes.
I did not add the cron statements to keep the code clean.
where "cicciobox" is the name of your virtual machine in a Sun VirtualBox server