Answer the question
In order to leave comments, you need to log in
Find find in unix environment and exclude directory. How to do?
You need to get all new files (created or modified in the last month) from the /home/user/subdir/ folder, but exclude the ./tmp folder (/home/user/subdir/tmp).
I try the following request - well, it doesn't work.
find /home/user/subdir/ -ctime -30 \( -path/home/user/subdir/tmp \) -prune -o -print > /root/new_files.txt
Answer the question
In order to leave comments, you need to log in
find /home/user/subdir/ -path /home/user/subdir/tmp/ -prune -o -ctime -30 -type f > /root/new_files.txt
Try like this:
find /home/user/subdir/ -ctime -30 -and -not \( -path /home/user/subdir/tmp -prune \) -print > /root/new_files.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question