LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-03-2012, 03:31 AM   #1
Springs
Member
 
Registered: Apr 2008
Posts: 73

Rep: Reputation: 0
Moving more than one folder?


Hi Guys.

I'm moving a few folders around my system and was wondering if there is a good command or switch i can use.

I want to copy more than one folder to another folder.

atm i and using mv "foldername" "new destination" && "folder2" "newdestingation"

is there anyway i can select more than one folder to move at once with out using the && command? similar to on a gui when you press and hold the "CTRL" button to multi select files / Folders

Thanks
 
Old 05-03-2012, 04:38 AM   #2
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 106Reputation: 106
Lightbulb

You can use find.

Code:

sudo find /top level of directories using / -type d -iname "Target 1" -or -iname "Target 2" -exec cp -Rv {} Destinaion/ \;

Just keep on expanding out as needed. You can also select by permisions, users, age. Check out man find for details.


Hope this helps.
 
Old 05-03-2012, 04:46 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by Springs View Post
Hi Guys.

I'm moving a few folders around my system and was wondering if there is a good command or switch i can use.

I want to copy more than one folder to another folder.

atm i and using mv "foldername" "new destination" && "folder2" "newdestingation"

is there anyway i can select more than one folder to move at once with out using the && command? similar to on a gui when you press and hold the "CTRL" button to multi select files / Folders

Thanks
Code:
mv folder1 folder2 destination/
 
Old 05-03-2012, 05:29 AM   #4
Springs
Member
 
Registered: Apr 2008
Posts: 73

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pwc101 View Post
Code:
mv folder1 folder2 destination/
thanks.

didn't think mv could do it with more than one.

Tried and worked fine

Thanks guys.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [APPENDED]Real moving of a folder's content to another folder. MODYSAMA Linux - Newbie 10 02-07-2011 11:30 PM
Moving a folder to a different partition Arituay Linux - Newbie 13 09-08-2007 06:59 PM
Moving my home folder. Lordandmaker Linux - Newbie 2 01-29-2006 02:08 PM
Moving home folder under Knoppix Lemop Linux - Newbie 1 01-22-2005 02:29 PM
moving a file to a folder gets error jackstoage Linux - Newbie 3 04-02-2004 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:39 AM.

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