Answer the question
In order to leave comments, you need to log in
How to find a file with the find command?
The task is this, there are many files and many directories modified:
/var/www/.../2019/modified/pict1_800x600.jpg
/var/www/.../2019/modified/pict1_1024x768.jpg
'...' - it is indicated for a reason, the path is not known
, these files must be deleted if there is no pict1_parent.jpg file in the /var/www/.../2019/ folder, the
task must be solved with Debian and bash utilities
Answer the question
In order to leave comments, you need to log in
find /var/www -type f -regex ".*/modified/[^/]+\.jpg" | while read -r path; do name="${path##*/}"; [ ! -f "${path%modified/*}${name%%_*}_parent.jpg" ] && rm -f "$path"; done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question