Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> cp parameters, paremeter to force overwite destination
linuxianer1958
 Posted: Jun 9 2015, 09:56 AM
Quote Post


SLF Newbie


Group: Members
Posts: 2
Member No.: 3446
Joined: 18-May 15









another working parameter ?

I mounted via nfs from an SuSE11.1 system
a homedirectory to a SL 6.3 system read only

is see the david*.is? files local in /mnt/gutemine/david_home/



i want copy all mounted files like david*.is? to the local homedirectory of david

local file permissions in destination directory are:
-rw-rw-rw- 1 david users 8192 11. Mär 2011 /home/david/david0.isa
-rw-rw-rw- 1 david users 1 11. Mär 2011 /home/david/david0.isx
-rw-rw-rw-. 1 david users 3989504 8. Jun 16:11 /home/david/david1.isa
-rw-rw-rw-. 1 david users 16280 7. Apr 09:03 /home/david/david1.isx


#cp -av /mnt/gutemine/david_home/david*.is? /home/david/
cp: »/home/david/david0.isa« überschreiben?

howto avoid the question "overwrite"
i want to force overwrite

man cp says --remove-destination
-f force
but the result is always the question "overwrite ?"

for example:
#cp -fva /mnt/gutemine/david_home/david*.is? /home/david/
cp: »/home/david/david0.isa« überschreiben

#cp --remove-destination /mnt/gutemine/david_home/david*.is? /home/david/
cp: »/home/david/david0.isa« überschreiben?

where is my mistake

Greetings from Krefeld Germany

Julius
PM
^
redman
 Posted: Jun 10 2015, 05:49 AM
Quote Post


Retired SLF Administrator
********

Group: Admins
Posts: 1276
Member No.: 2
Joined: 8-April 11









It could be the cause that the "cp -i" command may be aliassed somewhere.
What happens when you use "/bin/cp -rf <source> <destination>"?

--------------------
"Sometimes the best helping hand you can give is a good, firm push."
PM
^
linuxianer1958
 Posted: Jun 10 2015, 09:10 AM
Quote Post


SLF Newbie


Group: Members
Posts: 2
Member No.: 3446
Joined: 18-May 15









QUOTE (redman @ Jun 10 2015, 06:49 AM)
It could be the cause that the "cp -i" command may be aliassed somewhere.
What happens when you use "/bin/cp -rf <source> <destination>"?


1.
I do not think so.
fresh sl 6.3 installation.

2.
How ever Your hint works fine.!
also /bin/cp -rfav <source> <destination> works as expected.

i did not try this because

# echo $PATH says:

/home/david/lib/java/jre1.8.0/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:.:/home/david/bin:.:.:.

Thank you very much for help !

Julius

PM
^
redman
 Posted: Jun 10 2015, 10:43 AM
Quote Post


Retired SLF Administrator
********

Group: Admins
Posts: 1276
Member No.: 2
Joined: 8-April 11









QUOTE (linuxianer1958 @ Jun 10 2015, 11:10 AM)
I do not think so.
fresh sl 6.3 installation.

Sorry, but it is alliased. Not as user, but as root wink.gif
If you enter "alias" as root, you will get several ones, including:
QUOTE
alias cp='cp -i'

--------------------
"Sometimes the best helping hand you can give is a good, firm push."
PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll