3

If I as root in Nautilus at the top directory open the properties I get:

Name: /

Type: Folder (inode/directory)

Contents: 1 560 503 items, totalling 414,8 GB

Trying root@nilx:/# locate * | wc I get

2997356 3450407 217324980

and root@nilx:/# tree -ia gives me

277432 directories, 3293850 files

(directories+files=277432+3293850=3571282)

So how many files do I have?

user37342
  • 309

1 Answers1

1

locate is not suitable to count files!

It relies on what is saved in the updatedb database. But it leaves out some directories from the database when scanning. See /etc/updatedb.conf

PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot".

Nautilus defaults to not include hidden files in the Contents/Totalling section, you have to explicitly enable "show hidden files". Also it does not decend into other file systems, it does report the same as tree -ixa / though.


tree should work just fine.

But you could also use find, which should be faster than tree:

find / -printf . | wc -c
pLumo
  • 27,991