GRSYC file search and copy (Solved)

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chiefjim
Level 6
Level 6
Posts: 1157
Joined: Sun Jun 07, 2009 7:26 am
Location: South Texas, USA

GRSYC file search and copy (Solved)

Post by chiefjim »

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?
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.
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
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: GRSYC file search and copy

Post by Flemur »

chiefjim wrote: Thu May 13, 2021 8:46 am As she has several discs I'm figuring GRSYNC might be the easiest overall.
Other tools that may accomplish the task with desired results?
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?
chiefjim
Level 6
Level 6
Posts: 1157
Joined: Sun Jun 07, 2009 7:26 am
Location: South Texas, USA

Re: GRSYC file search and copy

Post by chiefjim »

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
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: GRSYC file search and copy

Post by Flemur »

chiefjim wrote: Thu May 13, 2021 11:45 amDoes not appear to allow search recursively. I need the solution to dig down multiple levels.
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?
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: GRSYC file search and copy

Post by mikeflan »

Other tools that may accomplish the task with desired results?
I do this often with this command:

Code: Select all

find /media/mike/a_long_path/searchdir -regextype egrep -regex ".*/.*\.jpg$" -exec cp '{}' /home/mike/Documents/copy7 \;
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.
chiefjim
Level 6
Level 6
Posts: 1157
Joined: Sun Jun 07, 2009 7:26 am
Location: South Texas, USA

Re: GRSYC file search and copy

Post by chiefjim »

mikeflan wrote: Thu May 13, 2021 9:19 pm
I do this often with this command:

Code: Select all

find /media/mike/a_long_path/searchdir -regextype egrep -regex ".*/.*\.jpg$" -exec cp '{}' /home/mike/Documents/copy7 \;
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.
Thanks Mike for the very usable solution.
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
Locked

Return to “Software & Applications”