Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i in *
- do
- if [ ! -f "$i" ] && [ -d "$i" ]
- echo "Element is a directory"
- then
- FILES=`ls -l "$i" | wc -l` # List the content of "$i" directory
- # and count the number of lines
- FILES2=`expr $FILES - 1` # Substract one because one line is
- # occupied with the number of blocks
- echo "$i: $FILES2" # Shows the name of the directory and
- # the number of inputs that it has
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment