Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

List given directory size, directories, and files bash

echo -e "Enter your directory: c"
read -r dirname

echo '============ Total Number of Files Are  ============ '
echo
echo $(sudo find $dirname -type f | wc -l)
echo
echo '============ Total Number of Folders Are  ============ '
echo
echo $(sudo find $dirname -type d | wc -l)
echo
echo '============ Total Number of Size (MB)  ============ '
echo
sudo du -sm $dirname | cut -f 1
 
PREVIOUS NEXT
Tagged: #List #directory #files #bash
ADD COMMENT
Topic
Name
6+4 =