How to use the mv command to move files from one dataset to another

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
Hey everyone I was interested in learning how to use the mv command between data sets I have my Media Library set on the Root Dataset and would like to re-located them to their own Dataset.. I am unsure how to use the mv Command Im hopping someone can help me out.

Thanks

Chris
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm not sure what there is to say--mv source destination is pretty much all there is to it. If you're unfamiliar with its usage, maybe you'd be better off with the Midnight Commander instead--run mc to start it.
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
I tried this command and found it freezes.. is this a command all non mouse input and all keyboard input
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I tried this command and found it freezes
What exact command did you try, and are you sure it freezes? If you're moving data from one dataset to another, you're making a new copy, then deleting the old. That takes time, and by default, the mv command doesn't give you any progress information.
is this a command all non mouse input and all keyboard input
I have no idea what you're asking here.
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
I went in the Cli and typed in The mc command and Midnight Commander came up and I moved the curser around and then it froze I shut down and oped it again and I moved the mouse around and it froze, the third time I used the arrows keys to move around I got further. but I accidentally used the mouse and again and it froze again..

im trying to moved folders from the root dataset to another dataset.

Im referring to one of my post I did a while back

 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Sounds like the answer is to not "accidentally use the mouse"--though I don't notice any effect from moving the mouse over a SSH window where I'm running mc on a FreeNAS box. If I click on something, it highlights. But AFAIK, mc is primarily controlled with the keyboard.
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
Ahhh Okay! Makes allot of sense thank you
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Also, rsync may be a better option than mv.
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
Please tell me more about rsync please
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Did you use google for any of those questions before asking people to spend time explaining it to you?
It's kinda rude imho.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
Did you use google for any of those questions before asking people to spend time explaining it to you?
It's kinda rude imho.
What, like reading the documentation......!!!
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
Well sorry I thought it would be easy enough, I shall not waste your time
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Well sorry I thought it would be easy enough, I shall not waste your time
Well, explaining a command is pretty much like explaining a program (which it actually is, just using a CLI).
One could give you a basic one liner that highlights the basic functionality, but that would often barely work or not work at all for your specific usecase, thats what manuals are for.

If you have a specific(!) question "I want this path, with these files, to this path, on this dataset. How would I go about that?" it might be faster to ask. But thats a specific question, your's is pretty vague "I have two folder, I need to move" and not knowing how MV works, also means you are, inter alia, asking for a bsd/cli/gnu basic-use tutorial...

So: It's not about "wasting" our time, it's more about wasting your own, ours and missing out on a great learning oppertunity ;-)
 

csearle

Contributor
Joined
Jan 18, 2019
Messages
189
Touché looks like I’ll be reading up on some info..

But here’s my situation I have a dataset named Media Library, I also have a folder called Media Library on my root dataset , which I have been told it’s a dataset crash..

My plan was to rename the folder and then move the data to the proper dataset
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Also, rsync may be a better option than mv.
Recommending rsync to someone who's asking how to use mv doesn't seem very sensible...
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
But here’s my situation I have a dataset named Media Library, I also have a folder called Media Library on my root dataset , which I have been told it’s a dataset crash..
What in the name of cthulhu is a "dataset crash"? :')
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
clash....
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
okey, simple fix in that case:
- mv /mnt/tank/media /mnt/tank/mediafolder
- Make sure all your media are in mediafolder
- remove the dataset
- recreate the dataset (just to be sure)
- mv /mnt/tank/mediafolder/* /mnt/tank/media/

That should do the trick
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Recommending rsync to someone who's asking how to use mv doesn't seem very sensible...
Very true. Plus, all he really seems to want to do is rename a folder...

And, FYI @csearle, this is the first search item when you enter "how to use rsync" into the Google... As others have said, we are all very willing to help those who help themselves.

Cheers,
 
Top