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.


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.

Universal configuration monitoring and system of record for IT.
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

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Commands by felix001 from sorted by
Terminal - Commands by felix001 - 20 results
ALT-U / ALT-L
xargs < [inputfile]
awk '{total+=$0}END{print total}' file
mkdir {1..100}
![command]
echo !$
if [ -x /sbin/arping ] ; then for i in {1..255} ; do echo arping 10.1.1.$i ; arping -c 1 10.1.1.$i | grep reply ; done ; fi
2011-02-21 21:03:09
User: felix001
Functions: echo grep
0

The following syntax will scan a range of IP addresses. At the point of a ARP response being received it will show a reply message.

www.fir3net.com

for i in `ndd /dev/ip \? | awk '{ print $1 }' | egrep -v "ip6|status|icmp|igmp|\?"` ; do echo $i `ndd -get /dev/ip $i` ; done | grep -v \?
2010-02-15 12:32:33
User: felix001
Functions: awk echo egrep grep
0

This command is jsut for the main IP settings of ndd. if you need ip6 or icmp edit the text within the egrep inclusion area.

Felix001 - www.Fir3net.com

> [filename].txt
2009-10-29 16:20:35
User: felix001
0

empties a file...

--- fir3net.com ---

x=1 ; while [ $x -le 10 ] ; do lynx -dump http://www.alexa.com/siteinfo/http://[YOUR WEBSITE] | grep Global | sed 's/ \|Global\|\,//g' >> /var/log/alexa-stats.txt ; sleep 5h ; done &
2009-10-17 13:48:05
User: felix001
Functions: grep sed sleep
0

This will record the Alexa Traffic Stats to a file and run every 5 hours.

-- www.fir3net.com --

HDD=$(df | awk ' NR>3 (S=$5) (M=$6) { if (S>90) print "Your Systems "M" is """S" Full" } ') ; [[ $HDD ]] && echo "$HDD" | mail -s "Hard-Drives Full" [email protected] -- -f [email protected] >/dev/null
Putty -d 8080 [server]
2009-10-15 06:54:58
User: felix001
0

Run this on a windows machine then add your localhost as a socks server for port 8080 within your web browser. Your traffic will now be proxying and sent via your server over ssh.

ssh -R 2001:localhost:22 [username]@[remote server ip]
2009-10-11 09:51:04
User: felix001
Functions: ssh
7

Allows you to establish a tunnel (encapsulate packets) to your (Server B) remote server IP from your local host (Server A).

On Server B you can then connect to port 2001 which will forward all packets (encapsulated) to port 22 on Server A.

-- www.fir3net.com --

grep $'\t' file.txt
getenforce
2009-10-08 23:06:00
User: felix001
-5

Shows the status of SElinux.

-- fir3net.com --

rsop.msc
2009-06-26 11:19:50
User: felix001
4

Type this into windows via run and it will display to you your complete policy for windows. This includes group policy, security policy and your active directory account (min password etc)....

www.fir3net.com

watch 'netstat -aniv'
ffmpeg -i [source].avi -f mp4 -vcodec mpeg4 -b 250000 -s 480?320 -acodec aac -ar 24000 -ab 64 -ac 2 [destination].mp4
mkdir -p /cdrom/unnamed_cdrom ; mount -F hsfs -o ro `ls -al /dev/sr* |awk '{print "/dev/" $11}'` /cdrom/unnamed_cdrom
2009-05-31 08:42:20
User: felix001
Functions: awk mkdir mount
-2

This will allow you to mount a CD-ROM on Solaris SPARC 9 or lower. This will not work on Solaris 10 due to void and the volume management daemons.

www.fir3net.com

lshw -C disk -html > /tmp/diskinfo.html