Define the following alias:
tar cvf - . | ( cd \!* ; tar xvf - )
or as an alias:
alias cpbytar 'tar cvf - . | ( cd \!* ; tar xvf - )'
(The alias definition above is for CSH)
To do a recursive copy of a directory to another location, preserving the PERMISSIONS and OWNERSHIP of the files. "cd" to the source location and invoke the following alias
cpbytar <destination_directory>
Return to : Unix System Administration
Hints and Tips