我正在使用rhel盒的磁盘。 我正在尝试查找/dev/sda2 所有文件。 我们有一个命令,可以在文件系统/dev/sda2给所有文件(理想情况下,大小)?
/dev/sda2 31297508 28615356 1092292 97% / mybox > df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda2 31297508 28615356 1092292 97% /
find / -mount -type f -ls
会列出所有类似于ls -dils的输出文件。
find / -mount -type f -printf "%s %h/%f\n"
只会打印尺寸和名称。
-xdev (或-xdev )选项告诉find不会下载到其他已挂载的文件系统(通常至less有几个),并type -f确保只列出文件而不列出目录或链接。
见man find更多的信息。