Other than typesetting and indexing tools, most apps shouldn’t be creating files that have single character file names. To find all the files with single character file names on a Mac, you could use find and then awk for the length of the file name: find / -type f -print| awk -F/ ' length($NF) == 1 ' You could also use mdfind or another tool to list all files and pipe that to the same awk -F/ ‘ length($NF) == 1 ‘ statement.
-
-
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.
-
Show All Files During Migration
When doing a data migration in OS X, you find that you often want to build a list of files on the source and the target media and then compare the two lists. When you do such a copy it’s important to verify that the data is all there. To find all the files on a drive, use the find command. If you’re in the working directory of the volume you’re transfering files from, the following command would show you all of the files on the volume: find . -name "*" To dump the contents to a file, use the > followed by the filename. So to list the contents…
-
Mac OS X: Easy Find
Using the find command is a little weird to people who are used to using locate. However, it is far more powerful and doesn’t come with the indexing requirements that locate does. So, if you’ve been using locate try and get familiar with using something like this instead (looking for slapd.conf – you can change that as needed): find / -name “slapd.conf” -print
-
Mac OS X: Find SetUID files
Granted it really doesn’t matter any more now that they’re not allowed, but if you need to find them here ya’ go: find / -type f ( -perm -4000 -o -perm -2000 ) -exec ls -al {} ; 2>/dev/null
-
Finding Things on Mac OS X
Mac OS X has a number of commands that will help you find things. There’s find, grep and way more. But the easiest of them all to use is locate. To run locate simply type the word locate from within terminal followed by the case sensitive string of what you are looking for. For example, if you want to find all files with the word Krypted in the name use the following command: locate Krypted Keep in mind when using the locate command that it will also find files that have the name in the path, so if I have a folder called Krypted, every single file in that folder…