Misleading (irritating) output from cp

Fergus Daly fergusd84@outlook.com
Fri Jul 4 05:18:29 GMT 2025


If you try
$ cp -v existingfile existingdirectory
you get feedback
'existingfile' -> 'existingdirectory/existingfile'
which is just fine. (Omitting the switch -v silences the feedback: also fine.)
Whereas: if you try
$ cp -v existingfile nonexistingdirectory
you get feedback (two lines)
'existingfile' -> 'nonexistingdirectory'
/bin/cp: cannot create regular file: No such file or directory
of which the 2nd line is useful advice but the 1st line is just a bit misleading / irritating / .. difficult to ignore .. whatever.
(Try the same / similar thing with any other command e.g. rm e.g. md5sum and you just get the 2nd line advice.)
Try
$ cp -v existingfile nonexistingdirectory 2> /dev/null
then you suppress line 2 as required; but you still get line 1 which now is _very_ misleading / _very_ irritating!
This "feature" is matched in Linux.
Maybe a small thing but not to me. (Where it occurs it rather screws up the smooth evolution of session logs.)
Does anybody know of a way of suppressing the 1st line feedback?
Thank you!
 


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /