in / you count all files on disks (and remote if mounted)
and in
/var you count also the file contained in /var/tmp
Sometime may be useful, I don't know if this is your case,
count file inside the filesystem without "traverse" it
also if the mount point of the 2nd fs is under the 1st
ex you have fs
/
/var
/home
/home/users
/usr
/usr/local
...
using
find /usr -xdev
find /home -xdev
you don't see files under /usr/local and /home/users filesystem
Hmm...I find that "find" is sometimes slow on larger filesystems.
You can also try:
du -a [starting point] | wc -l
This will list ALL files & directories (udnerneath) the starting point but there is no distinction between a directory and a file. For that you gotta use the find command.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.