Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th July 2008, 01:53 AM
craig_panama Offline
Registered User
 
Join Date: Dec 2007
Posts: 25
cp -Rf :confused:

It keeps asking me permission to copy... how do I get it to turn off the interactive?


edit(1) I posted this about an hr ago and I see about 13 views.. no replies

What I'm doing with "cp" is trying to upgrade a directory with sub-directories and files. To me this seems a fairly common operation.

So it seems "cp" is not designed with this in mind.

Of course there are work arounds. I can rename the old folder and create a new folder with the same name then copy all the files into it. One small problem. There are a few scripts that the upgrade files I'm coping from don't have. So then I have to copy those back into the newly created folder from the renamed folder.

This is a bunch of "bs" that you'd think I wouldn't have to deal with in Linux.

I can also use the "mv" command. Again though it has it draw backs

If you've got a suggestion I'd like to hear it. Is there a linux command that I'm not aware of. That wouldn't surprise me. I'd liked to be surprised in this case!

all this upgrading has to be done at by root so I can't just use GNOME cut and paste

Last edited by craig_panama; 16th July 2008 at 03:06 AM.
Reply With Quote
  #2  
Old 16th July 2008, 03:35 AM
ahvi's Avatar
ahvi Offline
Registered User
 
Join Date: Jun 2007
Posts: 116
This really belongs in either Software or General support. That's probably why you haven't had a response. These forums are fairly organized. This is also free support provided by the community. Please do not expect an answer right away, especially posting late at night. So give it a little while and post in the correct forums and most people will be more than happy to help you.

That said, I suggest that you read up on the root account and permissions and what makes these concepts such an integral part of the security of Linux.

Also, make sure you search the forums and don't forget the "man" command for reading the manual:

man cp

From your question, it looks like the "cp" command should be exactly what you're looking for. cp will copy all the files and folders from one place to another while respecting the folder structure as long as you are using the -R command.

cp -Rf [source] [destination]

Of course if you don't have the permissions, then you will need root access. The "su" command will give you this. If you are trying to attain root access from within a script, then you will need to use

su -c '[commands]'

So either only initiate the script from root, or use that command to call another script from within yours which will then get root access.
__________________
Fedora Objectives:
-To build the operating system exclusively from free and open source software.
-To do as much of the development work as possible directly in the upstream packages.

Non-Objectives of Fedora:
-Fedora is not interested in having a slow rate of change, but rather to be innovative.
-Fedora is not interested in being a platform for proprietary components.

Leigh's repo
Reply With Quote
  #3  
Old 16th July 2008, 03:40 AM
Wayne
Guest
 
Posts: n/a
Moved to General Support

Wayne
Reply With Quote
  #4  
Old 16th July 2008, 03:47 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Look into rsync.
Code:
man rsync
Reply With Quote
  #5  
Old 16th July 2008, 04:07 AM
A.Serbinski Offline
Registered User
 
Join Date: Jul 2006
Posts: 1,123
rsync is a good idea.

This issue with cp crops up when you're trying to copy files as *root*. Its a safety feature to make sure you don't do anything stupid.

You can always try out the deprecated option "--reply=yes". It'll give a warning that its deprecated, but it should still work.
Reply With Quote
  #6  
Old 16th July 2008, 04:30 AM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,487
Quote:
Originally Posted by craig_panama
It keeps asking me permission to copy... how do I get it to turn off the interactive?

edit(1) I posted this about an hr ago and I see about 13 views.. no replies

What I'm doing with "cp" is trying to upgrade a directory with sub-directories and files. To me this seems a fairly common operation.

So it seems "cp" is not designed with this in mind.
It could be your shell has an alias for "cp" so that it sees the "cp" command
as "cp -i" (or some longer alias mixture of options that includes i for interactive)

note that even if you use options typed right onto the command, the
previously aliased options get inherited on,

this would setup that alias
Code:
alias cp 'cp -i'
and would cause the shell to interpret this:
Code:
cp -Rf  [source] [destination]
as this:
Code:
cp -iRf  [source][destination]
How to resolve:

1) get rid of the alias just in that shell instance:
Code:
unalias cp
2) permanently, find the config file that does the alias cp 'cp -i'
and remove that line from the file

3) one-shot ignore the alias with \ as an escape:
Code:
\cp -Rf  [source][destination]
The fast way to see if this alias exists is just query for that
alias:
Code:
alias cp
Reply With Quote
  #7  
Old 16th July 2008, 04:34 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Gotta be kidding me?

Code:
[root@kiriyamablevins ~]# alias
alias cp='cp -i'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
[root@kiriyamablevins ~]#
Oh darn, nice feature.
Reply With Quote
Reply

Tags
confused

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused Jimmy Carter Installation and Live Media 19 2nd April 2006 03:39 AM
confused thewiz103 Installation and Live Media 1 27th January 2006 12:15 AM
Confused. Really. Crazy-Man Dan Installation and Live Media 2 12th September 2005 09:28 PM
creating custom linux distro:confused: :confused: :confused: noobiedora Using Fedora 2 27th February 2005 03:25 PM


Current GMT-time: 22:57 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat