Forrest logo
back to the identify tool

identify:tldr:6f616

identify: Collect dimensions of all JPEG files under current directory.
$ identify -format "%f,%w,%h\n" *.${jpg} > ${filenamelist-csv}
try on your machine

This command is made up of multiple elements and is mainly used to extract and store information about image files in a comma-separated values (CSV) format.

Here is a breakdown of the different parts of the command:

  1. identify: This is the command itself. It is commonly used in the ImageMagick software suite to retrieve information about images.

  2. -format "%f,%w,%h\n": The -format option is used to specify the output format. In this case, it defines the format as a string containing three placeholders:

    • %f: This represents the file name of the image.
    • %w: This represents the width of the image in pixels.
    • %h: This represents the height of the image in pixels.
    • ,\n: This adds a comma (,) between each value and a newline character (\n) at the end of each line.
  3. *.${jpg}: This is a wildcard pattern used to match all files with the extension ".jpg" in the current directory. The asterisk (*) represents any sequence of characters and the ${jpg} is likely intended to be replaced with the actual extension.

  4. > ${filenamelist-csv}: The greater-than symbol (>) is used to redirect the command's output to a file. The ${filenamelist-csv} appears to be a placeholder for the name of the file to store the output. It should be replaced with the desired name of the CSV file.

In summary, this command will gather image file information (filename, width, and height) for all files with the ".jpg" extension in the current directory. It will then store this information in a CSV file where each line contains the filename, width, and height separated by commas.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the identify tool