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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
Useful to move many files (thousands or millions files) over ssh. Faster than scp because this way you save a lot of tcp connection establishments (syn/ack packets).
If using a fast lan (I have just tested gigabyte ethernet) it is faster to not compress the data so the command would be:
tar -cf - /home/user/test | ssh user@sshServer 'cd /tmp; tar xf -'
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.
tar -czf and you spare that gzip pipe
why not try a nc? Here, I am assuming that you have shells open in both the systems. The netcat manual has an example which does just that.
@lv4tech : i believe that tar internally does the same, pipes it to gzip if its -z, and bzip2 if its -j.
You could also have ssh use a different (maybe less "secure") cipher like Blowfish or RC4:
tar -zcf - dirname | ssh -C blowfish-cbc user@host "cd /tmp; tar xfz -"see the different speeds yourself:
openssl speed aes rc4 blowfishIt'd be interesting to see how nc does versus ssh -C with blowfish or rc4/arcfour.
Is this really saving tcp connection establishment? I tried this with many mp3 files and what I observed was, as soon as I start running it, I start seeing mp3 files in destination. So, it looks like, as if, tar is archiving/compressing single mp3, sending it through ssh and then single archive file is uncompressed at destination. So, my question is, in this case, does tar archive files one by one or compress them into single archive?