W.A.S.S to print the total number of ordinary files, directories and executable files.
Program
# W.A.S.S to print the total number of ordinary files, directories and executable files.
echo "Total files:"
ls -1RF|grep -v [:/$]|tr -s "\n" | wc -l
echo "Total Directories:"
ls -1RF|grep [/$]|grep -v [:$]|tr -s "\n" | wc -l
echo "Total Executable files:"
ls -1RF|grep [h$]|grep -v [:/$]|tr -s "\n"|wc –l
Output
Total files:
35
Total Directories:
4
Total Executable files:
16