LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-23-2006, 10:55 PM   #1
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Rep: Reputation: 30
How to move a folder and replace files


Hi. I want to move a folder using terminal. I know this is done by:
Code:
mv /foo/foofolder /bar/barlocation
My question is: how do I move a folder if there is another folder in that location of the same name, and I want it to replace any same-named files, and add any files not already there?

Thanks.
 
Old 06-23-2006, 11:08 PM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
mv -f /foo/foofolder/* /bar/foofolder/

but, if there aren't too many files, mv -i would be more sensible unless you're absolutely positive you want to overwrite whatever is already there.
 
Old 06-24-2006, 12:11 AM   #3
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by rickh
mv -f /foo/foofolder/* /bar/foofolder/

but, if there aren't too many files, mv -i would be more sensible unless you're absolutely positive you want to overwrite whatever is already there.
Beautiful. Thanks a million.
 
  


Reply

Tags
commands, terminal



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
how to tell bash to move files to another folder? hq4ever Linux - Newbie 10 12-30-2010 03:15 AM
cannot using FTP move command to move files adrianmak Linux - Networking 4 04-21-2009 12:01 PM
i move my /etc folder in my /home folder Casanogab Linux - Newbie 8 03-31-2006 01:21 PM
making a script that will move a file or files in a trash folder Paxmaster Programming 5 12-12-2004 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:18 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
Open Source Consulting | Domain Registration