Trying to use GRSYNC to perform a file search and copy requirement. Been asked by a friend to extract all jpg files from various discs. These disc contents were from Apple products which has the files buried within sub-folders. Desired output is to dump all the found images into one folder without any associated sub-folders.
As she has several discs I'm figuring GRSYNC might be the easiest overall.
Other tools that may accomplish the task with desired results?
GRSYC file search and copy (Solved)
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
GRSYC file search and copy (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.
Mint-21.0 Mate 64 bit / LMDE-5 64 bit
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
Re: GRSYC file search and copy
I think (g)rsync will try to maintain the directory structure; a standard method would be to 'find' the jpg (jpeg for Apple? Check for both) files and copy them to a single place, as here:
https://www.linuxquestions.org/question ... ry-824339/
zsh lets you do this:
cd /to/dir/above/jpgs/
cp **/*.jpg /to/directory/.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: GRSYC file search and copy
Does not appear to allow search recursively. I need the solution to dig down multiple levels.
Mint-21.0 Mate 64 bit / LMDE-5 64 bit
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
Re: GRSYC file search and copy
The script at that link worked for me, with three directory levels.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: GRSYC file search and copy
I do this often with this command:Other tools that may accomplish the task with desired results?
Code: Select all
find /media/mike/a_long_path/searchdir -regextype egrep -regex ".*/.*\.jpg$" -exec cp '{}' /home/mike/Documents/copy7 \;
Re: GRSYC file search and copy
Thanks Mike for the very usable solution.mikeflan wrote: ⤴Thu May 13, 2021 9:19 pm
I do this often with this command:It works best if there are no duplicate named files in the search directory. All 'jpg' files (lower case only) are copied to copy7. It works recursively.Code: Select all
find /media/mike/a_long_path/searchdir -regextype egrep -regex ".*/.*\.jpg$" -exec cp '{}' /home/mike/Documents/copy7 \;
Mint-21.0 Mate 64 bit / LMDE-5 64 bit
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm