LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2010, 04:28 AM   #1
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Blog Entries: 1

Rep: Reputation: 21
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
 
Old 03-09-2010, 04:37 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
 
Old 03-09-2010, 04:50 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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.
 
Old 03-09-2010, 06:19 AM   #4
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Blog Entries: 1

Original Poster
Rep: Reputation: 21
hi gurus,

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Readline command issue... ddenton Linux - General 8 05-17-2010 12:10 AM
Postfix issue ; Must issue a STARTTLS command first after forcing TLS sarajevo Linux - Server 3 05-14-2009 09:28 AM
Readline command issue... ddenton Linux - Newbie 1 05-09-2008 03:01 PM
mv command issue Freestone Linux - Newbie 13 05-07-2006 04:47 PM
mail command issue ...!!! balavignesh Linux - Newbie 2 12-27-2005 09:19 AM


All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration