Transfer files and omit duplicates?
Is the command to copy files over from my USB to my Music folder without copying duplicates of the same files:
Code:
cp -u /home/<user>/<device> /media/<user>/Music ? ... UPDATE: no that is not the command because here is my error: Code:
cp: cannot stat ‘/home/cocolate/PENDRIVE’: No such file or directory Did not work Code:
cp -u /media/cocolate/PENDRIVE /home/cocolate/Music Code:
cp: omitting directory ‘/media/cocolate/PENDRIVE’ |
Try the following:
Code:
cp -uvn /home/<user>/<device> /media/<user>/Music |
Quote:
Code:
cp: cannot stat ‘/home/cocolate/PENDRIVE’: No such file or directory Im getting error for every way I tried that */PENDRIVE is no such file or directory. PENDRIVE is the name of my <device> (Name of <device> is 100% for sure PENDRIVE) |
I ran the command as sudo and I got this error
cp: omitting directory ‘/media/cocolate/PENDRIVE’ This is the command I used Code:
sudo cp -uvn /media/cocolate/PENDRIVE /home/cocolate/Music |
I added -r
now I am seeing lots and lots of text scroll down amidst various titles of my music.. |
Heres a sample of the string scrolling down. I had a folder inside the USB. I have read that is why I could not copy, but it looks like it isnt copying to my music folder?
Code:
‘/media/cocolate/PENDRIVE/Downloads/Beats by sally bobo - smile.mp3’ -> ‘/home/cocolate/Music/PENDRIVE/Downloads/Beats by sally bobo - smile.mp3’ Its not copying to music is it? Its copying back to the folder its from originally, no? Code:
-> '/home/cocolate/Music/PENDRIVE/Downloads/* I ran this command Code:
sudo cp -uvnr /media/cocolate/PENDRIVE /home/cocolate/Music |
Ya that was not it was not copying anything. PLEEEASE HEEEELP
|
Code:
cp -uvn /media/cocolate/PENDRIVE/*.mp3 /home/cocolate/Music (no need to sudo if you have access to /media/cocolate/PENDRIVE as normal user) |
Let's try this using rsync:
Code:
rsync -rv --progress --ignore-existing /media/cocolate/PENDRIVE/*.mp3 /home/cocolate/Music |
Quote:
Does it make a difference that I have folders within the folder within a folder copying from the PENDRIVE? Here is a string that is copying: Code:
Spirit - Moving Target (Juju RMX).mp3 ALSO SOME OF MY MUSIC ARE IN WAV FILES.......? |
OK what that did was copy everything from the PENDRIVE folder to the Music folder but it did not copy any of the folders within the folder of the PENDRIVE (I have 3 folders within folders). So I updated the command to include the name of those folders in the path.
Nothing copied twice. That was success and the files saved to music. Thanks Thanks Thanks! What about WAV files most likely I will just do it again and replace *.mp3 > *.WAV Awesome |
That should work for wav files as well. Be mindful that case does matter if your filesystem is case sensitive.
Your USB drive is likely FAT32, whereas your Linux system is more likely ext3 or ext4. FAT32 is not case sensitive where all ext filesystems are case sensitive. |
Yes thank you so much you made my day much easier and solved my problem. Truly appreciate everything.
|
Glad it worked. rsync is your friend, for local and network transfers. Remember to use the -z flag for network transfers to compress and save bandwidth, at the expense of a bit of CPU time.
|
All times are GMT -5. The time now is 11:11 PM. |