D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Using mv command

 

Something like

find 2013 -type f -print0 | xargs -0 -n 1 -I {} mv --backup=numbered {} 2013.new/

run in the directory containing your 2013 directory. You will need to create the  2013.new first as well.

I haven't tested this properly so maybe try it on some test files first.

Otherwise you could use cp with the -l option to build your new directory while leaving the old one in place

find 2018 -type f -print0 | xargs -0 -n 1 -I {} cp -l --backup=numbered {} 2018.new/

The -l option tells cp to make hard links which means that the entries in both the old directory and the new refer to the same file on disk.

Cheers,


Pete


On 28/10/18 17:22, Richard Brown wrote:

Hi All

I can't work this one out. Is it possible to move all files inside multiple folders to a single folder. I have a directory called 2013 and Google Photos has 'helpfully' put all images into multiple folders. 2013-6-01 etc. I want all images for 2013 to simply be in the 2013 folder. In addition to this I am trying to combine multiple photo libraries! So I am trying to

Take all images in multiple folders

Move to single folder

Check for duplicates and if so add 01, 02, 03

Is this possible using mv please?




-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq