Answer the question
In order to leave comments, you need to log in
Is it possible to add the size of the found to the search results output to a file?
In fact, now on Mac, I don’t know if there is a fundamental difference with Linux in this matter.
For example, I want to find all files and folders log and logs without case sensitivity, i.e. there is log, Log, logs Logs (I don't want to choose by "log*" because a lot of unnecessary things will fly out, logo for example).
I just search with -o and output the results to a file.
sudo find / -iname "log" -o -iname "logs" > logs.txt
/Users/user/logs 20K
/Users/user/gits/base/.git/logs 10K
/Users/user/Documents/Library/Logs 200M
Answer the question
In order to leave comments, you need to log in
it'll do?:
sudo find / -iname "log" -o -iname "logs" | xargs -l1 du -s > logs.txt
sudo find / -iname "log" -o -iname "logs" | xargs -l1 du -s | sort -g > logs.txt
find / -iname "log" -printf "%f %s\r\n"
man find
if it doesn't work, run ls with the required output format via -exec.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question