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/
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.
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.
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:
Streams youtube-dl video to mplayer.
syt 'youtube.com/link' 'anotherlinkto.video'
Uses mplayer controls
If you have a client that connects to a server via plain text protocol such as HTTP or FTP, with this command you can monitor the messages that the client sends to the server. Application level text stream will be dumped on the command line as well as saved in a file called proxy.txt.
You have to change 8080 to the local port where you want your client to connect to. Change also 192.168.0.1 to the IP address of the destination server and 80 to the port of the destination server.
Then simply point your client to localhost 8080 (or whatever you changed it to).
The traffic will be redirected to host 192.168.0.1 on port 80 (or whatever you changed them to).
Any requests from the client to the server will be dumped on the console as well as in the file "proxy.txt".
Unfortunately the responses from the server will not be dumped.
connect to it with any network command (including web browser - if you don't mind weird formatting)
nc 127.0.0.1 9876
Then just nc servername 2600 and ./script.sh
kill the client with ctrl+c. You can reconnect several times.
kill the server with exit
One person does `mkfifo foo; script -f foo' and another can supervise real-time what is being done using `cat foo'.
uses fifo and sets to a specific port. In this case 4201.
Shorter version with proper stderr redirection .
Please check out my blog article on this for more detail. http://jdubb.net/blog/2009/08/07/monitor-wireshark-capture-real-time-on-remote-host-via-ssh/
USAGE: gate listening_port host port
Creates listening socket and connects to remote device at host:port. It uses pipes for connection between two sockets. Traffic which goes through pipes is wrote to stdout. I use it for debug network scripts.
Forwards localhost:1234 to machine:port, running all data through your chain of piped commands. The above command logs inbound and outbound traffic to two files.
Tip: replace tee with sed to manipulate the data in real time (use "sed -e 's/400 Bad Request/200 OK/'" to tweak a web server's responses ;-) Limitless possibilities.