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 mrwill from sorted by
Terminal - Commands by mrwill - 7 results
while true; do while [ `date +%H%M` == "1857" ] ; do sleep 1s; yes | head -n 2000 > /dev/dsp; done; done;
2011-04-23 14:44:26
User: mrwill
Functions: head sleep yes
-1

this command will beep like an alarm for one minute from 18:57. you can change "1857" to your desired time.

you should have alsa-oss package installed, and you should also be root or part of "audio" group.

equery belongs $( which mv )
rename .txt .md *.txt
export MANPAGER='most'
2010-07-02 08:35:36
User: mrwill
Functions: export
1

you should have the "most" package installed. I like it because it is colorful and easier to read. alternatively you can use "less" instead of "most".

you can also add this to your ~/.bashrc to make it permanent.

ifconfig eth0 | awk '/inet / {print $2}' | cut -d ':' -f2
rpm -q --queryformat %{VERSION}\\n pkgname
2010-06-03 01:54:17
User: mrwill
Functions: rpm
1

if you want to see all information about a package use: rpm -qi pkgname

full list of querytags can be accessed by the command: rpm --querytags

you can also customize the query format how ever you like with using more querytags together along with escape sequences in "man printf"! you can also use more than one package name.

for example this command shows name and version in to columns: rpm -q --queryformat %-30{NAME}%{VERSION}\\n pkg1 pkg2

ps aux --sort=%mem,%cpu
2009-10-10 22:48:51
User: mrwill
Functions: ps
13

you can also pipe it to "tail" command to show 10 most memory using processes.