I need the output just like rm -v sample.txt
.
Are there options like "-v" in command find?
Tested with FreeBSD and Busybox implementations of find
:
$ find . -name sample.txt -delete -exec echo removed "'{}'" \; | sed "s,^removed '\./,removed ',"
removed 'sample.txt'
With GNU find you can also use -printf
:
$ find . -name sample.txt -printf "removed '%f'\n" -delete
removed 'sample.txt'