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:
Dump 389ds schema, putting "\n " on one line with perl.
You have to specify the objectclasses, attributetypes operational attributes too, otherwise they won't be dumped!
For quick validation of folder's file-contents (structure not taken into account) - I use it mostly to check if two folders' contents are the same.
An alias i made for myself to play music in a faster way.
Works great when you have Guake / Tilda installed (Console that drops down like in the game QUAKE)
I put this in my bash_alias file (I'm on ubuntu, the bash_alias file does autostart with the right config) but it works putting it in bashrc too. Or anything that autostarts when the console is opened.
Needs Mplayer and music files to work. With out music theres nothing to play!
Oh, and also, without modification, this alias will try to play stuff from your ~/Music folder! (case sensitive). Make sure that folder exists and has music OR edit this alias to fit your needs.
See external ip with w3m, simple and fast.
On a web site from Chile (spanish).
You don't want the -ar parameters in this case. The man page for BASH_BUILTINS(1) states:
"-a option means to remove or mark all jobs" and
"-r option without a jobspec argument restricts operation to running jobs"
In this case we are supplying the process id of the job to disown so neither of these should be used.
The first grep rejects capitalised words since the dict has proper nouns in it that you mightn't want to use. The second grep rejects words with ending in apostrophe s, and the third forces the words to be at least 15 characters long.
See more details at http://blog.amit-agarwal.co.in/2008/12/01/get-you-ip-address-like-whatismyipcom/
Replace "en1" with your network interface (on OS X, usually en0, en1, eth0, etc..)
smbfs or cifs, depends on which you are using
Does that count as a win for bzip2?
Prints the type of computer you have.
I think this should be used more in distros and other applications because it is so easy to get. This can also be asked by tutorials as an easy way to get your base hardware.
sudo dmidecode -s system-product-name
sudo smbios-sys-info-lite | sed -n 's/^Product Name: *\(.*\)/\1/p'
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
Very useful for test a script. After launch this command, you only have to press ENTER for launch your script again. I work with screen and tape ENTER instead of '!!'+ENTER
If you break your script with CTRL-C, it will wait for press ENTER and will re-launch
You can write like it : while read -p "Press ENTER" ; do python ; done
This is what we use.
You can grep -v 127.0.0.1 if you wish.