How to find number of files in every immediate sub-directory of $AW_HOME (UNIX/LINUX)?

Document ID : KB000089945
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
How to find number of files in every immediate sub-directory of $AW_HOME (UNIX/LINUX)?
Resolution:

Question:

How to find number of files in every immediate sub-directory of $AW_HOME (UNIX/LINUX)?


Answer:

Run the following command from $AW_HOME as the AM OS user:

> find . -type f -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c 

These results can be further sorted by number for files (decreasing order):

find . -type f -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn