I am using SSH to access my Ubuntu system and I have 100s of files across 100s of folders which are called xxxxx.mail.log
or xxxx.mail.log.xxx
I need to list all these files, and see their file size.
I have already tried ncdu
, which works, but I can’t search for filenames with it. Doing it manually with ncdu
takes hours.
What’s the easiest way to search my system for all files that contain mail.log
in their filename, and have them listed and display the file size?
find / -name "*.mail.log*" -printf "%s\t%p\n"
-printf "%s\t%p\n"
do?