[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cp sucks or do I not know enough?



Anil Gupte wrote:
I have read man cp and cp --help (same thing), but I cannot figure out how to shorten this: cp --reply=yes /foo/* .
I think you want -i

No -u does not work as expected and nor does -f Also, is there an equivalent of xcopy and I mean all the features. For example, in Dos/Win I am used to using, say: xcopy /s/e/d/y \foo\*.xyz \boo and sometimes xcopy /s/e/d/y/l \foo\*.xyz \boo (the /l gives me a list of files that would be copied without actually copying them). Basically I would like to copy the entire directory structure.
I don't know anything about xcopy, but to copy an entire directory structure you can use cp -r (recursive). You can use ls to see a list of all the files you are going to copy, then replace it with cp to actually do the copy. Example:

ls /foo/*.xyz      # To see the files it will select
cp /foo/*.xyz /boo

Also, make sure to use the forwardslash "/" instead of the backslash "\" in unix/linux environments.

Jason Martens



Reply to: