Answer the question
In order to leave comments, you need to log in
Why find: paths must precede expression?
I am writing a simple
bash question to search for files between minus 2 days and minus 1 day
DATE1=$(date -d "-2 days" +"%Y-%m-%d %k:%M:%S %z")
DATE2=$(date -d "-1 days" +"%Y-%m-%d %k:%M:%S %z")
find . -newermt $DATE1 ! -newermt $DATE2 -ls
Answer the question
In order to leave comments, you need to log in
But the fact that find already has a built-in algorithm + days - days does not bother you?
find. / -mtime +n
find ./ -mtime -n
Last resort file ./ -mtime +n -exec find -mtime -n file {} \;
What exactly are you trying to do?
Run the command line in Bash.
In him ! this is the launch of the previous command, after which something completely different from what you typed is given for launch. Needs to be masked! .
find. -newermt $DATE1 \! -newermt $DATE2 -ls
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question