Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图搜索一个 1033 字节大小的文件。经过半小时的谷歌搜索,我找到了一个显示当前目录中所有文件名和大小的命令。
find -printf 'Name: %16f Size: %6s\n'
如何%16f和%6s显示名称和文件大小?
%16f
%6s
我试图搜索一个 1033 字节大小的文件。
你可以说:
find . -type f -size 1033c
%f并且%s是printf选项的指令:
%f
%s
printf
%f File's name with any leading directories removed (only the last element). %s File's size in bytes.
说%16f会填充文件名;请注意,如果文件名超过 16 个字符,输出可能会被截断。