M
M
My joy2017-09-04 13:42:03
Debian
My joy, 2017-09-04 13:42:03

How to count the number of deleted files?

Good afternoon comrade friends.
There is a command for deleting old files in a folder and subfolders: is it possible to somehow display the number of files deleted? It's just that I will intercept the result in php, and for tests you need to understand.
find /path/to/folder/* -mtime +2 -exec rm {} \;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-09-04
@sim3x

No
You need to first run find and get the number of files
and then run with a parameter -deleteinstead of exec

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question