| Mobile| RSS

test 1

Friday, 8 January 2010 | posted in | 0 comments

Unix command to count number of files in present folder


  • ls | wc -l
  • If your folder has directories and files, and you want to count only files, use the below.
ls -l | grep ^[^d] | wc -l
  • find ./ -type f | wc -l
  • ls -F | grep -v -e "/" -e "@" | wc -w
Note: This will show you number of files but not any directory or symbolic links in the count.
  • If you would like to list out number of all the objects excluding directory then use
ls -F | grep -v "/" | wc -w

Read more: http://www.krishnababug.com/2008/03/number-of-files-in-directory.html#ixzz0c0tJzz8Y
Under Creative Commons License: Attribution Non-Commercial

0 Responses So far

Post a Comment

Labels

Blogumulus by Roy Tanck and Amanda Fazani

Twitter