mv -r /mnt/raid /mnt/raid/media
quick linux command question
Page 1 of 18 Replies - 819 Views - Last Post: 17 September 2009 - 11:40 AM
#1
quick linux command question
Posted 15 September 2009 - 05:44 PM
ok i just have a quick linux command question, i have a drive mounted at /mnt/raid that has a lot of folders and i want to move them all to /mnt/raid/media so would this command work? am not that good at linux and i just wanted to check that this will work because i dont want to mess anything up
mv -r /mnt/raid /mnt/raid/media
mv -r /mnt/raid /mnt/raid/media
Replies To: quick linux command question
#2 Guest_Neumann*
Re: quick linux command question
Posted 15 September 2009 - 06:01 PM
/mnt/raid points to the root directory of the mounted partition. The previous directory structure of /mnt/raid is now invisible to the OS. In addition, you're trying to copy the directory onto itself - it doesn't make sense and won't work anyway.
This post has been edited by Neumann: 15 September 2009 - 06:02 PM
#3
Re: quick linux command question
Posted 15 September 2009 - 06:07 PM
To further show what Neumann has just explained, you can check the output of df to view all of your mount-points along with their block names.
#4
Re: quick linux command question
Posted 15 September 2009 - 06:26 PM
oops i little type-o maybe i should had put -> mv -r /mnt/raid/* /mnt/riad/media/
would that work?
i know but i want to move all 100 folders that are in /mnt/raid into /mnt/raid/media, so is there an easy way of that that?
would that work?
Neumann, on 15 Sep, 2009 - 05:01 PM, said:
/mnt/raid points to the root directory of the mounted partition. The previous directory structure of /mnt/raid is now invisible to the OS. In addition, you're trying to copy the directory onto itself - it doesn't make sense and won't work anyway.
i know but i want to move all 100 folders that are in /mnt/raid into /mnt/raid/media, so is there an easy way of that that?
#5 Guest_Neumann*
Re: quick linux command question
Posted 15 September 2009 - 06:36 PM
realNoName, on 15 Sep, 2009 - 05:26 PM, said:
i know but i want to move all 100 folders that are in /mnt/raid into /mnt/raid/media, so is there an easy way of that that?
/mnt/raid/media is part of /mnt/raid, so you're trying to copy /mnt/raid/media onto itself. Again, this makes absolutely no sense and will not work. Simple as that.
#6
Re: quick linux command question
Posted 15 September 2009 - 06:36 PM
as long as media already exists. I would drop the dash r.
mv /mnt/raid/* /mnt/raid/media/
That will move all files & directories. So if you have any sub directories, it will move those too.
/mnt/raid/dir1/dir2/file
will be moved to
/mnt/raid/media/dir/dir2/file
Everything.
mv /mnt/raid/* /mnt/raid/media/
That will move all files & directories. So if you have any sub directories, it will move those too.
/mnt/raid/dir1/dir2/file
will be moved to
/mnt/raid/media/dir/dir2/file
Everything.
#7
Re: quick linux command question
Posted 15 September 2009 - 07:07 PM
ok thanks, i wanted to double check just because when it gets to the media folder i didn't know what it would do because that 1 folder isn't moving just every thing else if getting moved into it
#8
Re: quick linux command question
Posted 15 September 2009 - 07:11 PM
When it tries to move media it will complain about moving a directory into itself.
#9
Re: quick linux command question
Posted 17 September 2009 - 11:40 AM
maybe u want to unmount it and mount it in the new folder
Page 1 of 1

New Topic/Question
This topic is locked



MultiQuote


|