V
V
VicTHOR2020-03-02 10:00:54
linux
VicTHOR, 2020-03-02 10:00:54

How to find out the structure of a directory?

In general, there is a folder with subfolders with photos .
I made ls -lR dir/ | grep "^-" | wc
it. It showed that there are 119343 photos.
How can I find out what extensions are there (jpg, png or something else)
And how can I find out the maximum nesting depth?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2020-03-02
@VicTHOR

View statistics for extensions

find ./dir/ -type f | awk -F . '{print $NF}'  | sort | uniq -c | sort -nr

Look at the structure - for example, through
tree -d ./dir/

P
pfg21, 2020-03-02
@pfg21

find /path/ -name "*.png" | wc -l

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question