Web Hosting - WestHost Web Hosting

Go Back   WestHost Community Forums > Web Hosting > General Discussion

Reply
 
Thread Tools Display Modes
Old 09-17-2007, 10:13 AM   #1
drhansenjr
Junior Member
 
Join Date: Jan 2007
Posts: 13
Default Problems forcing overwrite using cp command

I thought doing a cp -rf <directory1>/ <directory2> would force an overwrite of all files recursively without prompting.

However, when I try that (updating a directory tree with WAY too many files to replace than I want to press "y" for), I still get prompted:

$ cp -rf foo/* bar
cp: overwrite `bar/myfile.php'?

???
drhansenjr is offline   Reply With Quote
Old 09-18-2007, 10:52 AM   #2
bruce.binder
Senior Member
 
Join Date: Sep 2003
Location: San Diego, CA
Posts: 119
Default

It is possible that the "cp" command is aliased to "cp -i" (prompt before overwrite.) I don't know how Westhost defaults their setups, but that's a common setting to help avoid mistakes. If you type "alias" at the command line, you can see a list of your aliases.

If that is the issue and you want to run an "unaliased" cp command, try

$ /bin/cp -rf foo/* bar

--
Bruce
bruce.binder is offline   Reply With Quote
Old 09-20-2007, 10:16 AM   #3
drhansenjr
Junior Member
 
Join Date: Jan 2007
Posts: 13
Default

You nailed it! Thanks! It's right there in .profile.
drhansenjr is offline   Reply With Quote
Reply

Thread Tools
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
ogg/vorbis, icecast, internet radio...? dmGremlin General Discussion 1 04-20-2010 08:32 PM
Installing MySQL 5. animestome PHP / MySQL 23 10-13-2006 05:13 AM
Cant upload using FTP of a user account avian E-mail / FTP Management 6 06-09-2006 01:18 AM
sa-learn shell command MNslappy E-mail / FTP Management 18 02-02-2005 01:52 PM
Some SSH-related problems (WestHost 2.0) FZ General Discussion 13 09-12-2003 11:29 AM


All times are GMT -6. The time now is 12:53 PM.

- Archive - Top

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.