Which of the following commands is used to remove files from the user file system, with a confirmation prompt, if they have neither been accessed nor modified in the last one year?
find /user/* (-mtime +365 -a -atime +365) -ok rm {} ;
grep (/usr/*) -mtime +365 | -ok rm
find -mtime +365 | rm
find -name -mtime +365 / -ok rm
View Answer
Correct Answer: A — find /user/* (-mtime +365 -a -atime +365) -ok rm {} ;
Explanation:
The find command with -mtime and -atime flags locates files based on modification and access times, and -ok rm {} \; prompts for confirmation before deleting.
