Unix General Question: Download Questions PDF
What will be the result if we run the command #find /tmp -mtime -2 and #find /tmp -mtime +2?
![Unix General Interview Answer Unix General Interview Question](https://globalguideline.com/public/images/interview/2.png)
Answer:
find /tmp -mtime n where n can be +ve or -ve
+n says, file modified in last n days
-n says, file modified more than n days ago
ex. if today is 5th of a month
file1 has mtime 3rd
file2 has mtime 2nd
then find . -mtime 2 will report file1
then find . -mtime -2 will report file2 only
+n says, file modified in last n days
-n says, file modified more than n days ago
ex. if today is 5th of a month
file1 has mtime 3rd
file2 has mtime 2nd
then find . -mtime 2 will report file1
then find . -mtime -2 will report file2 only
Download Unix General Interview Questions And Answers
PDF