Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
3 The `-r` option is a force of habit, my bad.
source | link

I've always been fond of using the -exec option:

find . -mindepth 2 -mtime +5 -type f -exec rm -rfvf {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

I've always been fond of using the -exec option:

find . -mindepth 2 -mtime +5 -type f -exec rm -rfv {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

I've always been fond of using the -exec option:

find . -mindepth 2 -mtime +5 -type f -exec rm -f {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

2 use code escapes where sensible
source | link

I've always been fond of using -exec as the fastest route for me.-exec option:

find . -mindepth 2 -mtime +5 -type f -exec rm -rfv {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

I've always been fond of using -exec as the fastest route for me.

find . -mindepth 2 -mtime +5 -type f -exec rm -rfv {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

I've always been fond of using the -exec option:

find . -mindepth 2 -mtime +5 -type f -exec rm -rfv {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.

1
source | link

I've always been fond of using -exec as the fastest route for me.

find . -mindepth 2 -mtime +5 -type f -exec rm -rfv {} \;

The -v after rm will print the file that will be deleted, but displaying output on the console does seem to slow things ever so slightly, so if speed is the requirement I would leave that out.