Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a single linux command that will move a directory and its contents to a different physical location, i.e. into another directory?
yes, of course - probably mv is what you're looking for.
The mv command doesn't care whether the object you wish to move/rename is a single file or a directory.
yes, just "mv directory new_directory". nothing fancy at all.
Quote:
Originally Posted by Doc CPU
Hi there,
yes, of course - probably mv is what you're looking for.
The mv command doesn't care whether the object you wish to move/rename is a single file or a directory.
[X] Doc CPU
That's what I tried, and it did this
Code:
~/Films/The Tragedy of Macbeth (1971) DVD9 $mv . /media/500gb/Films
mv: inter-device move failed: `.' to `/media/500gb/Films/.'; unable to remove target: Is a directory
~/Films/The Tragedy of Macbeth (1971) DVD9 $mv '.' /media/500gb/Films/
mv: inter-device move failed: `.' to `/media/500gb/Films/.'; unable to remove target: Is a directory
~/Films/The Tragedy of Macbeth (1971) DVD9 $mv "." /media/500gb/Films/
mv: inter-device move failed: `.' to `/media/500gb/Films/.'; unable to remove target: Is a directory
you can't move the directory you are in, as calling it "." means that the destination will be "." in the destination directory, which IS the directory itself, which makes no sense.
Last edited by acid_kewpie; 12-04-2011 at 01:14 PM.
you can't move the directory you are in, as calling it "." means that the destination will be "." in the destination directory, which IS the directory itself, which makes no sense.
Thanks, got it now. It has to be like so, from a different directory
Code:
mv "/home/g/Films/The Tragedy of Macbeth (1971) DVD9" /media/500gb/Films/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.