Selecting n random files from one directory and copying them to another folder + other files with same same, but different filetype
0
votes
1
answer
1197
views
I have two directories, lets call them **X** and **Y**
Within them I have 100k+ files, .jpg files in **X** and .txt files in **Y**
I want to randomly select **N** files from **X** and copy to folder **Z**
This should be manageable using find + shuffle.
I then want to find all of the files in **Y** with the same names of the files that were copied to **Z**, but they are .txt files and copy them to directory **W**
To visualize:
N files from **X** >> **Z**
Same N files from **Y** >> **W**
How would I go about doing that?
Asked by Martin Pedersen
(3 rep)
Aug 2, 2022, 06:54 AM
Last activity: Aug 2, 2022, 08:55 AM
Last activity: Aug 2, 2022, 08:55 AM