Don't Use strip Carelessly

One nice way to save space in your filesystem is by running strip () on directly-executable (binary) files. You'll probably think of running it recursively with find (). Be careful. On some operating systems, using strip on a setuid file () will strip the setuid bit; the program won't be setuid anymore. It's best to tell find to skip setuid and setgid files. For instance, the command below finds all world-executable files () that are not setuid or setgid ():

% find . -type f -perm -0001 ! -perm -4000 ! -perm -2000 ...

Other files that shouldn't be stripped include the UNIX kernel (like /vmunix) and files that developers need to debug.

- JP