Pages

Thursday, February 28, 2013

How to Count no. of files/directory in a directory


Steps are mentioned in snapshot , To count no of files/directory in a directory
> go to directory (here DistSys) in which you have to find no. of files and folders
>now run ls command and pipe it's output to command " wc -l "

cd DistSys
then
ls | wc -l

which gives a number say 11 ,which means directory DistSys contains 11 files or folders.


No comments:

Post a Comment