Skip to content

Instantly share code, notes, and snippets.

@avimehenwal
Created March 14, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avimehenwal/7d45b2e49839dcc9f7f27215a54c0fb3 to your computer and use it in GitHub Desktop.
Save avimehenwal/7d45b2e49839dcc9f7f27215a54c0fb3 to your computer and use it in GitHub Desktop.
Reduce PDF Filesize
for file in *.pdf;
do;
$(gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=c-$file $file);
echo "PROCESSED : $file";
done
@avimehenwal
Copy link
Author

Replacing last 4 chard for file

mv -v $name | echo $name | sed 's/.\{4\}$//'

@avimehenwal
Copy link
Author

Removing .pdf for all filename

for file in *.pdf;                               
do              
mv -v $file $(echo $file | sed 's/.\{4\}$//');
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment