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:
There are 3 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.
Why would you do this as opposed to cp -r? Is this faster? I'm too lazy to try it out...
Well, for starters it preserves ownership, mode, timestamps, and links. Then again, so does cp -a, so I really don't know.
cp's -a switch does --recursive, --preserve=mode,ownership,timestamps,links and --no-dereference
I fail to see the point in using tar like this. Anyone? It'd make more sense if the extract command was an arg to ssh, to happen on a remote machine, and tar was set to compress the data.
Depending on where the source and destinations live (same partition, same disk, same machine) this approach can have merit sometimes because it introduces a buffering via the pipe and the reading and writing are driven by two different tar processes rather than a single cp process. If it is faster that way, I think that would be why.
However, on the same machine I don't think this is likely to be faster, but I have definitely verified that when copying files between machines in this way (via putting an ssh user@host in front of either cmd) can be way faster than a single scp command, due to the buffering.
Oh, the old classic ;-)
That way more reliable when using nfs. I didn't believe it, but it happened to me that on some systems (tru64, aix, solaris) cp-ing tonns of files to nfs3 fails while tar | tar - works smoothly...
Anyway it could be that on newer release of nfs those issues won't arise.. but if you want to be sure...tar is for free :P