MacUser2525:/Volumes/Sea_To_Do/working/New_To_Convert/HB_Converted$ find . -name *.mkv | wc -l
16
find /Users//Documents/ -type f | sed -n 's/..*\.//p' | sort | uniq -c
2 DS_Store
1 jpg
232 doc
2 pdf
1 flac
10 xls
2 txt
Yeah, the find command is quite nice. I had a feeling a command line option would be easy to find online.thank you for your answers.
With your help and searching for some information I could find the next code that works for me:
Code:find /Users//Documents/ -type f | sed -n 's/..*\.//p' | sort | uniq -c
the result:
Code:2 DS_Store 1 jpg 232 doc 2 pdf 1 flac 10 xls 2 txt
Now, the problem I have is I cannot figure it out how to exclude the hidden files like: DS_Store
I have some HDDs with many files inside folders and subfolders that I have to check.
An AppleScript would be great.
.
An AppleScript would be great.
set theInputFolder to choose folder
set theExtensionsToSearchFor to {"txt", "pdf"}
set fileNamesToOmit to {"testfile.pdf"}
set theResults to {}
repeat with theExtension in theExtensionsToSearchFor
tell application "Finder"
set theFiles to (every file of entire contents of folder theInputFolder whose name extension is theExtension and name is not in fileNamesToOmit)
set theResults to theResults & {{|count|:count of theFiles, ext:theExtension as text}}
end tell
end repeat
I'd 100% be using the bash/command line route. But since you specifically asked about AppleScript then you could do it something like this.
Code:set theInputFolder to choose folder set theExtensionsToSearchFor to {"txt", "pdf"} set fileNamesToOmit to {"testfile.pdf"} set theResults to {} repeat with theExtension in theExtensionsToSearchFor tell application "Finder" set theFiles to (every file of entire contents of folder theInputFolder whose name extension is theExtension and name is not in fileNamesToOmit) set theResults to theResults & {{|count|:count of theFiles, ext:theExtension as text}} end tell end repeat
find /Users/Documents -type f \! -name .DS_Store
find parameters | egrep -v "DS_Store$|\.exe$|\.foo$|\.xyz$" | sed
MacUser2525:~$ find /Volumes/Sea_To_D/ -type f | wc -l
find: /Volumes/Sea_To_D//.Spotlight-V100/Store-V2/456D6B27-6244-4E8D-A017-15F7949564A9/Cache: Permission denied
38705