LM 17.3 KDE 64
I have between 1000 - 2000 jpg-files in 2 folders. I can have files with the same name but a different files size and I want to keep both or keep the larger file.
Ist there a terminal command which either
keeps both files with and additional number at the end of the filename
or
keeps the larger files?
Thanks for your help!
command to identify similar filenames [SOLVED]
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
command to identify similar filenames [SOLVED]
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: command to identify similar filenames
Moved this to the scripting forum as I think the requirement to among files with the same name keep the biggest one might need some scripting. There's a thread here with ideas about how to find duplicates based only on filename, as a start for such a script: https://stackoverflow.com/questions/162 ... ctory-bash
The duplicate searching tools I know are fslint and fdupes (both in the repository) and both have a command line interface (fslint also has a GUI), see information here https://www.pixelbeat.org/fslint/ and here https://github.com/adrianlopezroche/fdupes. I don't know these will do what you want.
I'd suggest to give fdupes a try first and just let it find duplicates in both directories and see if that list what you'd expect (use
The duplicate searching tools I know are fslint and fdupes (both in the repository) and both have a command line interface (fslint also has a GUI), see information here https://www.pixelbeat.org/fslint/ and here https://github.com/adrianlopezroche/fdupes. I don't know these will do what you want.
I'd suggest to give fdupes a try first and just let it find duplicates in both directories and see if that list what you'd expect (use
fdupes -S -r dir1 dir2
to recurse and show filesizes). If the list is short enough just delete by hand perhaps. See its manpage for more options.Re: command to identify similar filenames
Déjà Vu: viewtopic.php?f=18&t=266622&hilit=stat#p1456053
That script synchronizes two directories, keeping only the bigger one of same-named files.
That script synchronizes two directories, keeping only the bigger one of same-named files.
Re: command to identify similar filenames
viewtopic.php?f=18&t=266622&hilit=stat# ... 3@xenopeek
Moving it to the Scripting Forum is no issue at all. Next time I will go with similar questions to the Scripting Forum.
Thanks for the very usefull fdupes command. I could use it to find out the I only had files with the same name and same size. Lucky me!
@rene
Thanks for the hint with the very interesting bash script. I saved the link for the future
Moving it to the Scripting Forum is no issue at all. Next time I will go with similar questions to the Scripting Forum.
Thanks for the very usefull fdupes command. I could use it to find out the I only had files with the same name and same size. Lucky me!
@rene
Thanks for the hint with the very interesting bash script. I saved the link for the future