从 Linux 命令行列出文件夹中所有图像的宽度和高度
List width and height of all images in a folder from Linux command line
我想在 Linux 中通过命令行在列表中查看所有 jpg 图像的图像尺寸。以下代码仅适用于一张图片。
identify -format "%wx%h" xxxx.jpg
我想这就是你需要的
xargs identify -format "%wx%h\n" < <(ls -tr1)
或
ls -1 | xargs -L1 identify -format "%wx%h\n"
如果您的文件名中有空格,您可以使用此命令,它指定 '\n'
作为分隔符。
ls *.jpg | xargs -d '\n' -L1 identify -format "%wx%h\n"
如果你想将文件名映射到维度,你可以在你的模式中使用%f
:
ls *.jpg | xargs -d '\n' -L1 identify -format "%f: %wx%h\n"
我想在 Linux 中通过命令行在列表中查看所有 jpg 图像的图像尺寸。以下代码仅适用于一张图片。
identify -format "%wx%h" xxxx.jpg
我想这就是你需要的
xargs identify -format "%wx%h\n" < <(ls -tr1)
或
ls -1 | xargs -L1 identify -format "%wx%h\n"
如果您的文件名中有空格,您可以使用此命令,它指定 '\n'
作为分隔符。
ls *.jpg | xargs -d '\n' -L1 identify -format "%wx%h\n"
如果你想将文件名映射到维度,你可以在你的模式中使用%f
:
ls *.jpg | xargs -d '\n' -L1 identify -format "%f: %wx%h\n"