On Fri, Nov 14, 2003 at 05:26:26PM +0100, Christopher Odenbach wrote: > > Hi, > > > The times reported by an ls -l seem to be sane, and of those perms I > > checked, they were preserved ok. The major hiccup I had was that cp > > doesn't do ".name" files > > Of course "cp" does copy dot-files. I think you may have stumbled over > the shell asterisk. > > If you say "cp -rp * /somewhere", the shell expands the "*" to all files > and dirs in that directory except those beginning with a dot! > > Try "echo *" - you get a list of the files in the current directory but > without the dot files. > > You may use "cp * .??*" as a workaround (.??* means all filenames that > begin with a dot but excludes ".." which would be too much), but that > won't cover files like ".a" or similar dot-and-one-letter filenames. >
If you really want/must to use cp, you can get all the entries with the -A option of ls. It is like -a except it omits the "." and ".." directories. cp -rp `ls -A` dstdir # or ksh/bash: cp -rp $(ls -A) dstdir Have to be done as root to preserve ids and permissions with the "-p" option and as noted, does have a symlink problem. -- Jon H. LaBadie [EMAIL PROTECTED] JG Computing 4455 Province Line Road (609) 252-0159 Princeton, NJ 08540-4322 (609) 683-7220 (fax)
