Ubuntu find command and printf argument



我试图搜索一个 1033 字节大小的文件。经过半小时的谷歌搜索,我找到了一个命令,显示当前目录中的所有文件名和大小。

find -printf 'Name: %16f Size: %6sn'

%16f%6s如何显示名称和文件大小?

我试图搜索一个 1033 字节大小的文件。

你可以说:

find . -type f -size 1033c

%f%sprintf 选项的指令:

          %f     File's name with any leading  directories  removed  (only
                 the last element).
          %s     File's size in bytes.

%16f会填充文件名;请注意,如果文件名超过 16 个字符,输出可能会被截断

最新更新