Hide

What's this?

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/

Get involved!

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.

Hide

Stay in the loop…

Follow the Tweets.

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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

Commands by spiffwalker from sorted by
Terminal - Commands by spiffwalker - 6 results
google docs edit --title "To-Do List" --editor vim
2010-06-21 16:15:42
User: spiffwalker
Tags: google
36

Google just released a new commend line tool offering all sorts of new services from the commend line. One of them is uploading a youtube video but there are plenty more google services to interact with.

Download it here: http://code.google.com/p/googlecl/

Manual: http://code.google.com/p/googlecl/wiki/Manual

This specific command courtesy of lifehacker:http://lifehacker.com/5568817/

Though all can be found in manual page linked above.

google youtube post --title "My\ Video" --category Education ~/myvideo.avi
2010-06-19 00:04:48
User: spiffwalker
6

Google just released a new commend line tool offering all sorts of new services from the commend line. One of them is uploading a youtube video but there are plenty more google services to interact with.

Download it here: http://code.google.com/p/googlecl/

Manual: http://code.google.com/p/googlecl/wiki/Manual

mplayer http://minnesota.publicradio.org/tools/play/streams/the_current.pls < /dev/null | grep --line-buffered "StreamTitle='.*S" -o | grep --line-buffered "'.*'" -o > mus & tail -n0 -f mus | while read line; do notify-send "Music Change" "$line";done
2010-05-09 17:51:40
User: spiffwalker
Functions: grep read tail
7

Plays the mp3 stream of The Current as a background job. When you are done run:

fg %1

then to exit

Quite possible with Growl for mac I'd guess, although have not tried.

Libnotify needed for notification, stream will still work otherwise

nano +X foo
2010-04-27 01:57:58
User: spiffwalker
Tags: nano
6

Starts the cursor on line X of file foo. Useful for longer files in which it takes a long time to scroll. If X is greater than the number of lines in file foo, it will go to the last existing line.

hcitool scan
2010-04-11 04:13:15
User: spiffwalker
Tags: bluetooth
6

Scans local area for visible Bluetooth devices. Use 'hcitool inq' to discover the type of device it is. And use -i hciX option to specify the local Bluetooth device to use.

curl -s http://twitter.com/username | grep 'id="user_' | grep -o '[0-9]*'
2010-04-04 18:43:14
User: spiffwalker
Functions: grep
Tags: twitter curl
2

This will tell you which twitter user you are chronologically. For example, a number of 500 means you were the 500th user to create a twitter account.