1.delete all executable files under certain directory
find /directory -type f -executable -delete
or
find /directory -type f -executable -exec rm -f {} \;
Above command will delete the executable files in sub-directory.
To specifically delete all executable files in your home directory (not in sub-directories) and ask you whether you want to delete each file you can do something like
find ~ -type f -executable -maxdepth 0 -exec rm -i {} \;
时间: 2024-08-08 19:04:55