- I need to delete all files with a pattern name:
2020*.js - Inside a specific directory:
server/db/migrations/ - And then show what it have been deleted: `| xargs“
I’m trying this:
find . -name 'server/db/migrations/2020*.js' #-delete | xargs
But nothing is deleted, and shows nothing.
What I’m doing wrong?
>Solution :
You’re looking for something like this:
find server/db/migrations -type f -name '2020*.js' -delete -print