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.

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:



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!

Top Tags



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 tagged socat from sorted by
Terminal - Commands tagged socat - 7 results
socat udp-listen:1611 system:'ssh remoteserver "socat stdio udp-connect:remotetarget:161"'
2013-07-02 15:08:14
User: kbo
Tags: ssh socat

Forward local UDP port to remotetarget via ssh.

socat -u FILE:/var/log/syslog,ignoreeof TCP4-LISTEN:12345,fork,reuseaddr
2013-02-18 13:36:01
User: ichbins
Tags: socat

it also works with the chrome browser. The alternative with tail and nc doesn't

socat unix-connect:/tmp/socket stdio,echo=0,raw
2012-12-19 07:58:09
User: mhs

Create a serial console with "socket (named pipe)" of "/tmp/socket", "from:server, to:virtual machine" in vmware player, etc.. gui. Run the above command after you have booted the guest OS (which should also be configured for serial console).

socat TCP4-LISTEN:3128,reuseaddr,fork TCP6:[xxxx:xxxx::xxxx]:3128
2012-06-07 04:35:24
User: kiiwii
Tags: socat proxy ipv6

Say I have configured a fully optimized squid server A listen on [xxxx:xxxx::xxxx]:3128, within ISP_foo.

But when I was with ISP_bar , I can not access the proxy with full speed due to ISP's limit upon the normal clients among different ISP.

If you are curious where the ridiculous ISPs are, I'll tell you the truth --that's CHINA.

However, servers' network connection is not enslaved to that limitation, especially with IPv6.

So, I can do this socat linefu on a server B of ISP_bar.

me >> B(ISP_bar)>> A(ISP_foo)

socat READLINE EXEC:'sqlplus',pty,setsid,ctty
2011-08-24 14:17:41
User: TommyBotten

Perhaps a bit of a niche, but if you've even been frustrated by Oracles sqlplus command line tool for not supporting readline - have no fear. Socat is here to help you.

(sleep 3; echo "MyAwesomePassword"; sleep 3) |socat - EXEC:'ssh [email protected] "hostname"',pty,setsid,ctty
2011-08-24 14:13:18
User: TommyBotten
Functions: echo sleep
Tags: socat pts

You should really use keys. Really. I'm serious.

But if you have to add your key, change password etc. for a long list of servers, this might help.

socat -v tcp4-l:<port> tcp4:<host>:<port>