ExifTool is a powerful command-line tool for reading, writing, and editing metadata in image, video, and document files.
Install ExifTool on Linux using the following command:
> sudo apt install exiftool
To display all metadata of a file:
> exiftool image.jpg
To extract a specific metadata field, such as the camera model:
> exiftool -Model image.jpg
Change the author name in an image file:
> exiftool -Artist="New Author" image.jpg
To remove all metadata from an image:
> exiftool -all= image.jpg
To copy metadata from one file to another:
> exiftool -TagsFromFile source.jpg target.jpg
Change the author name for all JPG files in a folder:
> exiftool -Artist="New Author" *.jpg
To remove GPS location data from an image:
> exiftool -gps:all= image.jpg
To display metadata in JSON format:
> exiftool -json image.jpg
A Bash script to extract metadata from all images in a folder:
> #!/bin/bash
> read -p "Enter directory path: " dir
> for file in "$dir"/*.jpg; do
> exiftool "$file" > "$file.txt"
> done
A Bash script to remove all metadata from every image in a directory:
> #!/bin/bash
> read -p "Enter directory path: " dir
> for file in "$dir"/*.jpg; do
> exiftool -all= "$file"
> done