I have a directory with a ton of files I want to find the average file size of these files so something like ls somethinghere whats the average file size of everyth
du -sh . # gives the total space used by the directory
find . -type f | wc -l # count the number of files
devide the first by the second. If you want a one liner, here it is:
echo $(( `du -sb | tr '.' ' '` / `find . -type f | wc -l` ))