Earlier quoted context omitted.
rsync is slow if the data is not already on the destination. tar over ssh is fast, and tar over socketpipe is even faster but not encrypted. I'm not aware of any attributes that tar doesn't preserve.
How so? Also, I find that if I'm going to copy the data once, I'm often going to copy it twice, or which to get a more up to date version of it at a later time. Rsync clearly wins in these cases. Finally, from the compress flag on rsync: Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of t…
Unix tricks
131–140 of 232 posts
Re: Unix tricks
#132Whut? ctrl-r? How have I missed that? No more 'history|grep foo' for me!
Try this in your .inputrc: # Bind the up arrow to history search, instead of history step "\e[A": history-search-backward "\e[B": history-search-forward No more "^rls" to search for ls in your bash history; just type "ls" and start hitting the up arrow.
Re: Unix tricks
#133Wanted: a lint for your history that analyzes your commandline usage, suggesting these types of tips based on your historical use. history | commandlint
Re: Unix tricks
#134All extremely useful, my favourite being the .inputrc rebindings of up and down to search history. Takes a little getting used to but is great once you are (good luck to anyone else trying to use your terminal though ;))
Re: Unix tricks
#135If I may add a trick: ctrl-z - stops a program bg - sends the stopped program to the background fg - gets the program back to the foreground (interactive mode) very useful in editor sessions or when you want to get rid of the endless download/scp that is blocking your terminal
fork() { (setsid "$@" &); }
in myzshrc, and then start stuff with :
fork firefox
Re: Unix tricks
#136Whut? ctrl-r? How have I missed that? No more 'history|grep foo' for me!
Try this in your .inputrc: # Bind the up arrow to history search, instead of history step "\e[A": history-search-backward "\e[B": history-search-forward No more "^rls" to search for ls in your bash history; just type "ls" and start hitting the up arrow.
I got tired of sshing into a new box and half the things I'd type wouldn't work properly until I remembered to copy my settings files over, which seemed more trouble than it was worth for a short-lived s3 instance.
That's why I was excited to discover ctrl-r. It's a built-in method of searching history that I can remember and it'll work everywhere.
Re: Unix tricks
#137ack-grep is great for searching source code
https://github.com/ggreer/the_silver_searcher
I think you might like it.
Re: Unix tricks
#138zsh: setopt extendedglob allows you to use numeric ranges on globbing with : mv p1080 .jpg folderx/ to move p1080100.jpg through p1080300.jpg to a new folder. Still not available on bash or more common shells?
mv p1080{100..300}.jpg folderx/Re: Unix tricks
#139Earlier quoted context omitted.
This is simply not true: $ mkdir '; echo woops' $ find . -type d -exec echo {} ';' . ./; echo woops As you can see 'woops' is never echoed. EDIT: The reason being the shell is never involved in this process, and the shell is what is responsible for splitting commands on semicolons/newlines.
You are assuming the exact versions of the shell and find programs that you use are the only ones that exist. It may not be a problem on your exact system, but it can be a problem elsewhere.
Re: Unix tricks
#140Earlier quoted context omitted.
Sort will actually externally sort blocks into temp files and merge them. Adjusting this block size can help with thrashing. Awk may still be better for uniquification.
What about 'sort -u' ?