

(Be sure to verify that the new files are OK before erasing the originals.) Once in write With "_original" appended to their names. This causes each FILE to be rewritten, and by default the original files are preserved

To write or copy information, new tag values are specified with the - TAG = syntax or the To the console (or written to output text files with -w). Information is read from the source files and output in readable form One or more source file names, directory names, or "-" for the standard input. I hope you liked it.Exiftool FILEĮxiftool | d| x] ]įor specific examples, see the EXAMPLES sections below.Ī command-line interface to Image::ExifTool, used for reading and writing meta information in image, audio and video files. In this post, you learned an important part of manipulating PDF files. If you want to simply remove a metadata, then leave it blank exiftool -Author= document.pdfīut it is possible to clear them all exiftool -all= document.pdf So the syntax is simple, just define the metadata and specify the new value. exiftool -Author="Unixcop" sample.pdf Setting the PDF metadata exiftool -Creator="Unixcop" sample.pdfĪlso if a metadata is not specified, you can add it with the above syntax. In case you want to change some metadata, say the Creator. It can also be other metadata exiftool -Keywords sample.pdf This means that the output screen will only show the author of the document. If you would like to get only an extract of this metadata, you can do it as follows exiftool -Creator sample.pdf Note: For this post i used an sample PDF file from here exiftool sample.pdf Getting the PDF metadata

Of course, you can use relative and absolute paths to get the results. If you want to get the metadata of any PDF file, you can run exiftool Getting and changing PDF metadata on Linux using the terminal Once you have the package installed, you can continue with the post. If you are using Fedora, CentOS, RHEL, or Rocky Linux then you have to run: sudo dnf install perl-Image-ExifTool In the case of Debian, Ubuntu, Linux Mint and other members of the family, you can install it with this command: sudo apt install libimage-exiftool-perl To perform the task, we need a tool called exiftool with which we can edit the metadata of a PDF file without major problems.

Moreover, this will ensure that it will work in almost any environment. Many times in configuration scripts we can include various commands to automate processes, and file management is no exception.īesides this, it is always useful to have the terminal at hand, since it is faster and more efficient than in a graphical interface. So, you can quickly use it for a specific case or several files. In this post, I will show you How to get and change PDF metadata on Linux using the terminal.
