Mac OS X,  Mac Security,  Ubuntu,  Unix

Remove All Files Except jamf.log From A Directory

You can redirect a log file into a given directory. That directory, if it has other stuff in it, can get out of control. So, here, we’re going to remove all files except that file using the find command:

find * ! -name jamf.log -type f -delete

Once run, the jamf.log is the last file left in the directory.