5

Could anybody tell me how to count number of inodes of files inside a directory ?

Thanks.

Rtrj
  • 51
  • 1
  • 4

1 Answers1

0

There is one inode per directory, and one for each file in it. If you symlink a file, the symlink gets it's own unique inode as well. (I'm sure someone will correctly me if I've missed any edge cases.)

List the inode number of each file:

ls -i

To count the number of files in the current directory:

ls -1 | wc -l

see also: How to count number of files in multiple directories

Community
  • 1
  • 1
William Turrell
  • 3,227
  • 7
  • 39
  • 57