When I issue the command cp -af --reply=yes * ../other it tells me --reply is deprecated and use -i or -f. when I remove the --reply=yes I have to indicate 'y' to every file being copied. I just want to copy every file in my current directory to another directory and overwrite any file that is there. What is the correct way to do that? Jerry
Jerry Geis wrote:> When I issue the command cp -af --reply=yes * ../other > it tells me --reply is deprecated and use -i or -f. > > when I remove the --reply=yes I have to indicate 'y' to every > file being copied. > > I just want to copy every file in my current directory to another > directory and overwrite any file that is there. > > What is the correct way to do that?Use -f as the you got as the error message. [angenenr at shutdown test]$mkdir a b [angenenr at shutdown test]$touch a/foo a/bla [angenenr at shutdown test]$touch b/foo b/bla [angenenr at shutdown test]$cp -f a/foo a/bla b/ [angenenr at shutdown test]$ Cheers, Ralph -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080128/4a1cb9ee/attachment-0002.sig>
On Mon, Jan 28, 2008 at 01:45:15PM -0500, Jerry Geis alleged:> When I issue the command cp -af --reply=yes * ../other > it tells me --reply is deprecated and use -i or -f. > > when I remove the --reply=yes I have to indicate 'y' to every > file being copied. > > I just want to copy every file in my current directory to another > directory and overwrite any file that is there. > > What is the correct way to do that?Using csh/tcsh? You are running into an alias. Simply escape cp or call with full path: \cp -f /bin/cp -f -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080128/446d1417/attachment-0002.sig>
Jerry Geis wrote:> When I issue the command cp -af --reply=yes * ../other > it tells me --reply is deprecated and use -i or -f. > > when I remove the --reply=yes I have to indicate 'y' to every > file being copied. > > I just want to copy every file in my current directory to another > directory and overwrite any file that is there. > > What is the correct way to do that?I assume you're doing this as root... The system-defined shell aliases are your enemy. Try typing /bin/cp instead of just cp to bypass the nanny-OS insisting that you need interactive mode instead of defaulting to doing what you said. (Type "which cp" to see what is happening). -- Les Mikesell lesmikesell at gmail.com
On Mon, Jan 28, 2008, Jerry Geis wrote:>When I issue the command cp -af --reply=yes * ../other >it tells me --reply is deprecated and use -i or -f. > >when I remove the --reply=yes I have to indicate 'y' to every >file being copied. > >I just want to copy every file in my current directory to another >directory and overwrite any file that is there. > >What is the correct way to do that?``unalias cp'' then do your real work. You will then only be prompted when attempting to remove files without write permission. If you feel like a responsible adult, you might want to comment out the other aliases in your .profile or other startup files which appear as: alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 Mechanical Engineers build weapons. Civil Engineers build targets.
Jerry Geis wrote:> When I issue the command cp -af --reply=yes * ../other > it tells me --reply is deprecated and use -i or -f. > > when I remove the --reply=yes I have to indicate 'y' to every > file being copied. > > I just want to copy every file in my current directory to another > directory and overwrite any file that is there. > > What is the correct way to do that?As others have mentioned, I usually just do 'unalias cp' first. But you can also do yes | cp (cp options) which will say y to every prompt cp spits out. nate