Sample Header Ad - 728x90

Delete all files without user permissions

4 votes
4 answers
1206 views
I have a prompt that asks me to delete all the files in a directory that the owner (u) can't r, w, nor x, in one command. I tried this command:
find data -type f ! -perm -u=rwx -exec rm -f {} \;
... but I think it removes too many files.
Asked by cow (81 rep)
Oct 15, 2023, 10:22 PM
Last activity: Nov 17, 2023, 07:46 AM