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.

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

Hide

Credits

Broadcast your shell thru UDP on port 5000

Terminal - Broadcast your shell thru UDP on port 5000
script -qf >(nc -ub 192.168.1.255 5000)
2011-04-23 12:38:25
User: Archiater
Functions: script
1
Broadcast your shell thru UDP on port 5000

Better solution in case of many clients, imo.

Alternatives

There are 3 alternatives - vote for the best!

Terminal - Alternatives
script -qf | tee >(nc -kl 5000) >(nc -kl 5001) >(nc -kl 5002)
2010-10-11 07:55:30
User: clvv
Functions: script tee
Tags: tee pipe script nc
37

run 'nc yourip 5000', 'nc yourip 5001' or 'nc yourip 5002' elsewhere will produce an exact same mirror of your shell. This is handy when you want to show someone else some amazing stuff in your shell without giving them control over it.

bash -i 2>&1 | tee /dev/stderr | nc -l 5000
2010-10-20 18:32:12
User: pykler
Functions: bash tee
Tags: nc
4

Doesn't work so well if you connect from windows. Linux only sends LF where windows wants CRLF. The alternative command works better with windows, however it uses script and a named pipe.

script -qf | tee >(nc -l -p 5000)
2013-04-13 00:22:02
User: nesses
Functions: script tee
Tags: tee pipe script nc
-1

solution that works for me

Know a better way?

If you can do better, submit your command here.

Your point of view

You must be signed in to comment.