Score:-1

find command skips directory entirely

cn flag

i am trying to separete my .NEF raw files and .JPG raw files from within a directory tree - this to enhance the digikam program not reading to many files.

I already came a great way in finding commands - but for some reason it skips 1 folder entirely

So i am running ubuntu server (Where this is all happening) 22.04 - the files are on the server and mounted to my local laptop. First i was trying to do this on the mounted drive - then i SSH'ed my way onto the server just to get the same results.

The used command to (test) and separate the files, but preserving the directory tree :

sudo find -name "*.jpg" -print0 | xargs -0 cp -vu --parents -t /mnt/Foto/Nikon_JPG/

(Obviously i am inside the folder containing the files)

up to a certain point this works well - but not all the time and with various results so then i got annoyed that the folder was skipped and the command not generating the output i wanted i turned to freefilesync to do it GUI style.

now that worked perfect - i just need to find a way to remove the files with the extension .jpg on the folder tree.

therefor i first wanted to make sure the list of removed files is what i expect from the command : and used this :(before adding the --delete option

find . -name "*.jpg" -type f > filelist.txt

the output just ignores 1 entire folder named 2023 : (like the previous command)

drwxrwxrwx 1 root root    40960 Apr  2  2014  001
drwxrwxrwx 1 root root        0 Jul 13  2013  2011
drwxrwxrwx 1 root root    16384 Mar 15  2020  2012
drwxrwxrwx 1 root root     8192 Oct  4  2018  2013
drwxrwxrwx 1 root root     4096 Oct  4  2018  2014
drwxrwxrwx 1 root root     4096 Oct  4  2018  2015
drwxrwxrwx 1 root root     4096 Dec  3  2018  2016
drwxrwxrwx 1 root root     8192 May  1  2020  2017
drwxrwxrwx 1 root root     4096 Feb  4  2019  2018
drwxrwxrwx 1 root root     8192 Aug  2 10:46  2019
drwxrwxrwx 1 root root     4096 Dec 20  2020  2020
drwxrwxrwx 1 root root     4096 Jun  5  2022  2021
drwxrwxrwx 1 root root     4096 Aug  2 17:24  2022
**drwxrwxrwx 1 root root     4096 Aug  2 18:53  2023**
drwxrwxrwx 1 root root     4096 Jun 14  2015 'To be editted'

and the last 3 lines of the filelist.txt

./2022/DSC_0149.jpg
./2022/DSC_0149_1.jpg
./2022/Sinterklaas handbal delen/DSC_5170-1.jpg

this happens on the local mounted directory, on the serverside directory - it all ends up ignoring that 1 directory - and i seem to be unable to put the finger on the hotspot - it all is root - and RWX are identical to the other directory...

Can anyone guide me in the direction on why this directory is being ignored?

Edit 1

Added out put :

namei -lx /mnt/Foto/Nikon_Raw/2023/Capfun\ 2023/
f: /mnt/Foto/Nikon_Raw/2023/Capfun 2023/
Drwxr-xr-x root root /
drwxr-xr-x root root mnt
Drwxrwxrwx root root Foto
drwxrwxrwx root root Nikon_Raw
drwxrwxrwx root root 2023
drwxrwxrwx root root Capfun 2023
muru avatar
us flag
Are you sure there are `.jpg` files in that directory? `.JPG` != `.jpg` != `.jpeg` != `.JPEG`
hr flag
... perhaps running `find ./2023 -name "*.jpg" -type f` would be helpful - also bear in mind that the directory traversal order doesn't necessarily guarantee that the results from 2023 will be at the *end* of the `filelist.txt` file
Diet Bos avatar
cn flag
@muru : i am 100% sure there are jpg files in that directory
Diet Bos avatar
cn flag
@steeldriver : CTRL+F : 2023 did not give any results, apart from the file names containing 2023 - and agree that the output is not necesarily in alfabetic order - in this case it is.
muru avatar
us flag
@DietBos add the output of `namei -lx <some jpg file in 2023>`
Diet Bos avatar
cn flag
@muru : output added.
Raffa avatar
jp flag
@DietBos muru asked for the output of that command on a file and not a directory as you did … Also keep in mind that `find` is a filename search tool and not a filetype search tool so your filenames need to end exactly in `.jpg` in order to be found.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.