Multiple choice general knowledge science & technology

Which of the following is the command to find 30 days old files in the location /app/unix if you are currently at location /tmp/user?

  1. find /app/unix -mtime +30 -exec ls -lrt {} \ /tmp/user;

  2. find /app/unix -mmonth +1 -exec ls -lrt {} \;

  3. find /app/unix -mday +30 -exec ls -lrt {} \;

  4. find /app/unix -mtime +30 -exec ls -lrt {} \;

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The find command with '-mtime +30' finds files modified more than 30 days ago. The '-exec' flag allows executing a command on each found file, and 'ls -lrt' lists them with details. The escaped semicolon '\;' terminates the -exec command. Option A incorrectly includes '/tmp/user' in the command. Options B and C use non-existent flags (-mmonth, -mday).