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 xmuda from sorted by
Terminal - Commands by xmuda - 10 results
while [ 1 ]; do echo -e "220 ProFTPD 1.3.3c Server [ProFTPD] \nFAILED FTP ATTEMPT - PORT 21" | nc -vvv -l 192.168.1.65 21 >> /var/log/honeylog.log 2>> /var/log/honeylog.log; done
2013-07-16 19:05:37
User: xmuda
Functions: echo
-1

[root@dhcppc1 windows]# cat /var/log/honeylog.log

Connection from 192.168.1.71 port 21 [tcp/ftp] accepted

Connection from 192.168.1.65 port 21 [tcp/ftp] accepted

[root@dhcppc1 windows]# nc 192.168.1.65 21

220 ProFTPD 1.3.3c Server [ProFTPD]

FAILED FTP ATTEMPT - PORT 21

*You can not run it if you have activated the ftp server.

firefox imacros://run/?m=macros.iim &
lynx --dump twitter.com/(username) | sed -n "132,134 p"
2013-07-06 16:28:10
User: xmuda
Functions: sed
0

I was using some twitter bots and twitter bloks my IP. Now im using some proxys and i use these command to validate the tweet was published.

ssh -X -l user 192.168.1.25
2013-04-30 13:48:28
User: xmuda
Functions: ssh
-6

One time you logged in, you can prove these method just writing "firefox".

sleep 10; poweroff
2013-04-13 22:07:15
User: xmuda
Functions: sleep
-11

If you are on your bed, waching a movie or if you are downloading something, but you whant to sleep. You can use these easy command to power off after X time. The time is in sec. if you whant to wait 1 H, use:

sleep 3600; poweroff

for a in $(seq 5 8); do cat twit.txt | cut -d " " -f$a | grep "^@" | sort -u; done > followlst.txt
2013-03-29 21:07:09
User: xmuda
Functions: cat cut grep seq sort
-6

Go to "https://twitter.com/search/realtime?q=%23TeamFollowBack&src=hash" and then copy al the text on the page. If you scroll down the page will be bigger. Then put al the text in a text file called twit.txt

If you follow the user there is a high probability the users give you follow back.

To follow all the users you can use an iMacros script.

if lynx --dump http://twitter.com/xmuda | grep -q "Sorry, that page does"; then echo "Dont Exist"; else echo "Exist"; fi
2013-03-23 16:12:24
User: xmuda
Functions: echo grep
-4

I use these command to validate twitter accounts, we can use a "for a in $(cat list.txt)" to validate a complete list of twitter accounts.

true | mailx -n -a MYTEXT.txt -r my@mail.com -s log -S smtp=mail.com -S smtp-auth-user=MYUSER -S smtp-auth-password=MYPASSWORD FRIEND@mail.com
2013-03-12 16:37:30
User: xmuda
Functions: mailx true
5

It is the best way i found to send a mail from the console in my centos server.

lynx --dump http://en.trending-topic.com/countries/Mexico/ | grep "62]#" | sed 's/\[62\]//g'
2013-03-12 16:25:14
User: xmuda
Functions: grep sed
-1

In these command i use lynx to get the top trend topic of Mexico, if you replace Mexico with other country, you will get the #1 Trending topic

su -c 'sync; echo 3 > /proc/sys/vm/drop_caches'