Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

verbose copy



i've seen this tossed around on a few command line oriented mailing lists, 
but i've never never seen a ~good~ solution for a verbose copy... 
something that will show the status of files *while* being copied.

i wanted to see the progress of a >700MB file being copied to a flash 
drive, and figured it out.

here it... this is a single line alias in my .zshrc file:

alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"

of course it requires rsync to be installed.

this works in zsh, and should work in all derivatives of the bourne 
shells. some shells (csh and derivatives) may need the syntax changed to 
assign an alias.

i now have a "cpv" command that acts as a verbose copy, and it properly 
handles globs.

the options that i used, tweak as needed...
  -p - preserve permissions
  -o - preserve owner
  -g - preserve group
  -h - output in human-readable format
  --progress - display progress
  -b - instead of just overwriting an existing file, save the original
  --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
  -e /dev/null - only work on local files
  -- - everything after this is an argument, even if it looks like an option


-- 
         ...atom

  ________________________
  http://atom.smasher.org/
  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
  -------------------------------------------------

 	"Anyone who has the power to make you believe absurdities
 	 has the power to make you commit injustices."
 		-- Voltaire




Messages sorted by: Reverse Date, Date, Thread, Author