Linux - Delete everything except specific file, Finding all files with SUID and SGID
Delete everything except specific file
Remove everything except that file
# find . ! -name <FILENAME> -deleteit will remove everything except the file names matching you can use also use wildcards
Finding all files on local file system with SUID and SGID set
find / \( -local -o -prune \) \( -perm -4000 -o -perm -2000 \) -type f -exec ls -l {} \;
The topic on Linux - Delete everything except specific file is posted by - Patel
Hope you have enjoyed, Linux - Delete everything except specific fileThanks for your time