Guy's
I have file system called /appspft has millions of files and I want to know exactly how many file under it
Pls advice with that command to verify number of files ..
Guy's
I have file system called /appspft has millions of files and I want to know exactly how many file under it
Pls advice with that command to verify number of files ..
Ty using command ls directory name | wc -l it will count the no. files as well no. of directories.
Regards
Ahmed
you can use the following find command:
find /appspft/* -print | wc -l
the * is necessary because its prevent from the up directory to be include in the count (see example below)
this will include folder in the count if you want to exclude the you can use the -type in the find command like this:
find /appspft/* -type f -print
# find /appspft/* -print | wc -l
10
# find /appspft/* -type f -print | wc -l
7
# find /appspft/* -print
/appspft/appspft1
/appspft/appspft2
/appspft/appspft3
/appspft/appspft4
/appspft/dir1
/appspft/dir1/appspft1
/appspft/dir2
/appspft/dir2/appspft2
/appspft/dir3
/appspft/dir3/appspft3
# find /appspft/* -type f -print
/appspft/appspft1
/appspft/appspft2
/appspft/appspft3
/appspft/appspft4
/appspft/dir1/appspft1
/appspft/dir2/appspft2
/appspft/dir3/appspft3
hope this help.