How to list all files of a partition on linux?
find / -mount -type f -ls
will list all files like with an output similar to ls -dils
.
find / -mount -type f -printf "%s %h/%f\n"
will just print the size and the name.
The -mount
(or -xdev
) option tells find to not descend into other mounted file systems (which /
usually has at least a few of) and type -f
makes sure only files and not directories or links are listed.
See man find
for more info.