Convert every file in directory to different format in linux (eg pdf to eps with pdftops)

Below a simple bash statement that will convert every file in the current directory. As an example, every pdf file in the current directory will be converted to the eps format using pdftops.

find ./ -maxdepth 1 -name "*.pdf" -exec pdftops -eps {} \;

Explanation:
find → use the program ‘find’
./ → start looking in the current directory
maxdepth 1 → do not look in subdirectories
name "*.pdf" → look for files with extension “.pdf”
exec → for every such file, do the following:
pdftops → use the program ‘pdftops’
eps → use the option ‘eps’
{} → substitute every match of the ‘find’ command here
\; → end of command

Advertenties

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit / Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s