Forrest logo
back to the exiftool tool

exiftool:tldr:51a26

exiftool: Recursively rename all JPEG photos in a directory based on the `DateTimeOriginal` field.
$ exiftool '-filename
try on your machine

This command is using the exiftool software to rename image files in a specified directory based on the DateTimeOriginal field in their metadata. Here is a breakdown of the command:

  1. exiftool: This is the command used to execute the exiftool software.

  2. '-filename<DateTimeOriginal': This is a command-line option that instructs exiftool to rename the files based on the DateTimeOriginal value.

  3. -d %Y-%m-%d_%H-%M-%S%%lc.%%e: This option specifies the desired output format for the renamed files. It uses a combination of date and time elements in the format of Year-Month-Day_Hour-Minute-Second, followed by a lowercase extension.

  4. ${path-to-directory}: This is the path to the directory where the image files are located. You need to replace ${path-to-directory} with the actual path on your system.

  5. -r: This option tells exiftool to process files recursively inside subdirectories of the specified directory.

  6. -ext jpg: This option specifies that only files with the extension "jpg" should be processed. You can modify this value if you want to handle different file extensions.

In summary, the command will use exiftool to rename all JPEG image files in the specified directory and its subdirectories, renaming them based on the DateTimeOriginal field in their metadata using the specified format.

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 exiftool tool