Bash 下面的示例命令中使用的x变量是什么

Bash 下面的示例命令中使用的x变量是什么,bash,command,find,Bash,Command,Find,在这篇帖子中,2012年12月5日,DogBane给出了以下回复: FILECOUNT="$(find . -type f -maxdepth 1 -printf x | wc -c)" DIRCOUNT="$(find . -type d -maxdepth 1 -printf x | wc -c)" 谁能告诉我x-after-printf是什么意思或用于什么 谢谢。-printf x只需为每个匹配打印一个x,没有新行或任何其他内容(特别是文件名) 这些find命令只需为找到的每个文件(或目

在这篇帖子中,2012年12月5日,DogBane给出了以下回复:

FILECOUNT="$(find . -type f -maxdepth 1 -printf x | wc -c)"
DIRCOUNT="$(find . -type d -maxdepth 1 -printf x | wc -c)"
谁能告诉我x-after-printf是什么意思或用于什么


谢谢。

-printf x
只需为每个匹配打印一个
x
,没有新行或任何其他内容(特别是文件名)

这些
find
命令只需为找到的每个文件(或目录)打印一个字符,然后计算字符数(
wc-c
)。

另一种说法是:
FILECOUNT=“$(find.-type f-maxdepth 1 | wc-l)”
。。。如果这有帮助的话。。。