Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
NickTheGreek

How to count number of files in each directory?

Recommended Posts

ωραίο άρθρο αυτο και με πολλαπλές λύσεις,

 

για παράδειγμα:

find . -type d -print0 | while read -d '' -r dir; do
    files=("$dir"/*)
    printf "%5d files in directory %s\n" "${#files[@]}" "$dir"
done

αλλά αυτό είναι το πιο ενδιαφέρον:

du -a | cut -d/ -f2 | sort | uniq -c | sort -nr

https://stackoverflow.com/questions/15216370/how-to-count-number-of-files-in-each-directory

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×