On Sun, 8 Feb 1998, Hamish Moffatt wrote: > On Sun, Feb 08, 1998 at 10:45:04PM +1100, Craig Sanders wrote: > > > cp -ax /* /mnt > > > ( cd /; tar clvf - * ) | ( cd /mnt; tar xf - ) > > > > > that's because you're TELLING cp and tar to copy /mnt. * matches > > everything, remember...so cp -af /* /mnt means copy everything in / > > (including /mnt) to /mnt. > > Hmmmm. Fair enough, although counter-intuitive to me at least.
no, it's not counter-intuitive if you remember that the shell expands wildcards BEFORE passing the args to the program... so 'cd / ; tar clvf - *' gets expanded to 'cd / ; tar clvf - bin boot cdrom console dev etc floppy home lib lost+found mnt proc root sbin tmp usr var vmlinuz vmlinuz.old' and tar does exactly what you tell it to do - archive all of those files and directories. it will archive each of the directories in the order listed on the command line and for each one, the -l option will restrict it to just that fs mount. craig -- craig sanders -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .