E
E
Eugene Ordinary2017-05-01 15:30:18
linux
Eugene Ordinary, 2017-05-01 15:30:18

How to delete files recursively and conditionally using the command line?

How can I delete all files in a folder and all its subfolders, provided that the modification date of the file is no later than the given date, and the file extension is not equal to the given type?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2017-05-01
@evgeniy8086

find /path/to/dir/ -type f -newermt "1970-01-01 00:00:00" ! -name "*.type" -ls -delete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question