jeudi 2 novembre 2017

(Linux) How can I find a file with a random name in a folder without knowing the folders name?

Having a bit of a struggle as nothing I have tried seems to work.

I need a conditional script to copy files to a random number of folders (if they exist) with an unknown folder name.

I would prefer using the find command, but so far I haven't had any luck with it. I've given up and hoping someone can help. Hopefully I'm explaining this clear enough.

The directory structure is something like this:

/dir/dir/dir/001/ABC-ABCD/knownfilename.png

and/or like this

/dir/dir/dir/ABC-ABCD/knownfilename.png

So I need to copy/move files into the same folder replacing 1 of images with the same filename.

Thank you in advance <3

Aucun commentaire:

Enregistrer un commentaire