LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   issue with the cp command!!! (https://www.linuxquestions.org/questions/linux-newbie-8/issue-with-the-cp-command-794152/)

kingston 03-09-2010 04:28 AM

issue with the cp command!!!
 
hi all
i have some application packages in my apps filesystem. I need upgrade it. i brought the latest patches (its a java compiled file with 755 permission) and when i tried to copy into the apps filesystem it asks me to overwrite it or not. But i gave " cp -rf .... ****** " command. I am not in the position to delete the old files. It should overwrite. Can someone tell me what could be the problem and how it culd be resolved. I am using RHEL 5. The apps directory (filesystem) permission is 755 and i am doing all these things with root privilege.

Thanks in advance

Kingston S

druuna 03-09-2010 04:37 AM

Hi,

Redhat has aliased cp to use the -i flag (interactive), which will always asks if you want to override the file (even though you use the -f flag!!).

The following will unalias cp (just for the current session/terminal): unalias cp

If all went as planned you will not be bothered with the overwrite question.

Hope this helps.

PS: use alias cp to see the current setting.

colucix 03-09-2010 04:50 AM

In alternative (if you want to leave the alias for other uses) you can type a backslash before the cp command:
Code:

\cp file destination
this will uses the /bin/cp command without aliases.

kingston 03-09-2010 06:19 AM

hi gurus,

both the ways are working fine....Thanks...


All times are GMT -5. The time now is 06:26 AM.