SHELL SCRIPT TO DISPLAY THE NO OF FILES IN THE CURRENT DIRECTORY | URDINESH

Software Programming, Tutorials, Interview Preparations,Stock Market,BSE/NSE, General informations

Monday, July 20, 2015

SHELL SCRIPT TO DISPLAY THE NO OF FILES IN THE CURRENT DIRECTORY

DISPLAY THE NO OF FILES IN THE CURRENT DIRECTORY:

echo "to count the file in the directory"
count=0
for i in *
do count=`expr $count + 1`
done
echo $count




























OUTPUT:

[@localhost ~]$ sh totaldir.sh
to count the file in the directory
26

[@localhost ~]$

No comments:

Post a Comment

Thanks for your valuable comments

Followers