On Sun, Mar 10, 2013 at 3:37 AM, Henrik Juul Pedersen <[email protected]> wrote: > Hi Peng Yu, > > On Sun, Mar 10, 2013 at 5:58 AM, Peng Yu <[email protected]> wrote: > >> Hi, >> >> -i can prompt warning messages. But I have to type n to avoid >> overwriting files. I found 'yes' to print 'y' repetitively. Is there >> something I can use to cp without overwrite files but with warning >> messages printed automatically? > > > From the cp manual: > > -n, --no-clobber > do not overwrite an existing file (overrides a previous -i > option) > > Does this answer your question?
It does not print any warnings. I need the warnings (e.g., b.txt could be overwritten if -n were not used) be printed. echo a > a.txt echo b > b.txt cp -n a.txt b.txt -- Regards, Peng
