-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2023-03-08 a las 03:25 -0000, Robert Webb escribió:
On Mon, 6 Mar 2023 12:08:00 +0100, "Carlos E. R." <> wrote:
So maybe this:
cer@Telcontar:~> find . -path ./.dosemu -path /.cache -prune -o -name "*.png" -newermt 2023-01-01 2>&1 | grep -v 'Permission denied'
No, I see lots of:
./.cache/thumbnails/normal/c7dba33a30402263a4b13b42e37dcdd3.png ./.cache/thumbnails/normal/ad349eb75f1544c110bef048d1863dee.png ./.cache/thumbnails/normal/942fb32737e09f77a35fcbf77a6195cd.png
cer@Telcontar:~> find . -path ./.dosemu -prune -path ./.cache -prune -o -name "*.png" -newermt 2023-01-01 2>&1 | grep -v 'Permission denied'
Nah, same problem. Only one -prune is working.
Maybe:
cer@Telcontar:~> find . -type d -not -readable -prune -path ./.dosemu -prune -path ./.cache -prune -o -name "*.png" -newermt 2023-01-01
No:
./.cache/thumbnails/normal/91f916ae750a5dca8f2020fb68648166.png ./.cache/thumbnails/normal/028af4e97867a90eb4551b5be73a1e30.png ./.cache/thumbnails/normal/bd6057d9fa3d308ad94a610aa1f185c3.png ^C
'find' includes an implicit "and" operator (-a) between every pair of terms in the expression. In your first find above, the adjacent -path terms, "-path ./.dosemu" and "-path /.cache", are never both true for the same file or directory as find traverses the tree, and therefore the 'and' of the pair will always be false, and the -prune which follows them will never be invoked.
Ahhhh... I see.
The same situation exists with the other two find commands. It looks like you could fix those by just adding a '-o' after each -prune that isn't already followed by one.
For the first one, try: (missing dot for the cache path added)
find . \( -path ./.dosemu -o -path ./.cache \) -prune \ -o -name "*.png" -newermt 2023-01-01
This works: cer@Telcontar:~> find . \( -path ./.dosemu -o -path ./.cache \) -prune -o -name "*.jpg" -o -name "*.png" -newermt 2023-01-01 2>&1 | grep -v 'Permission denied' but produces a lot of entries I do not want: ./.wine/drive_c/users/cer/Application Data/Foxit Software/Foxit Reader/StartPage/Start/en_us/Default/show_con_bg.jpg ./.wine/drive_c/users/cer/Application Data/Foxit Software/Foxit Reader/StartPage/Start/en_us/Default/history_winbg.jpg ./.wine/drive_c/users/cer/Application Data/Foxit Software/Foxit Reader/StartPage/Start/en_us/Default/content_showbg.jpg So I try to prune them. I do: cer@Telcontar:~> find . \( -path ./.dosemu -o -path ./.cache -o -path ./.wine \) -prune -o -name "*.jpg" -o -name "*.png" -newermt 2023-01-01 2>&1 | grep -v 'Permission denied' ... ./.kodi/userdata/Thumbnails/3/3e507be4.jpg ./.kodi/userdata/Thumbnails/3/359a058f.jpg ./.kodi/userdata/Thumbnails/3/309b63d8.jpg ./.kodi/userdata/Thumbnails/3/308b6caa.jpg Ok, again. cer@Telcontar:~> find . \( -path ./.dosemu -o -path ./.cache -o -path ./.wine -o -path ./.kodi \) -prune -o -name "*.jpg" -o -name "*.png" -newermt 2023-01-01 2>&1 | grep -v 'Permission denied' | less -S ... ./Fotos Eclipse/DSC_5861.jpg ./Fotos Eclipse/DSC_5786.jpg ./Fotos Eclipse/DSC_5893.jpg That can not be. cer@Telcontar:~> l ./Fotos\ Eclipse/DSC_5861.jpg -rw-r--r-- 1 cer users 559598 Jul 28 2018 ./Fotos Eclipse/DSC_5861.jpg cer@Telcontar:~> cer@Telcontar:~> stat ./Fotos\ Eclipse/DSC_5861.jpg File: ./Fotos Eclipse/DSC_5861.jpg Size: 559598 Blocks: 1096 IO Block: 4096 regular file Device: 805h/2053d Inode: 2889284 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ cer) Gid: ( 100/ users) Access: 2022-10-21 11:41:37.594823655 +0200 Modify: 2018-07-28 13:57:08.747107912 +0200 Change: 2018-07-28 13:57:08.747107912 +0200 Birth: 2018-07-28 13:57:08.559115330 +0200 cer@Telcontar:~> How come? It is ignoring the "-newermt 2023-01-01" part. Baffled again :-??? - -- Cheers, Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCZAjsABwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVg+sAniNk9FFZ7sgyzijBkkMs RKPPr0HVAJ9giu08Dbc1n8AjwzmYCQKacH3AJw== =bGle -----END PGP SIGNATURE-----