Created
June 1, 2023 08:03
-
-
Save hornc/a83926c208329b1e6370d1fbf6dbfdbe to your computer and use it in GitHub Desktop.
Rename images to correctly sort them, and make a pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install reqs | |
sudo apt install rename | |
# Test rename command: | |
rename -n 's/(\d+)(?=.*\.)/sprintf("%03d",$1)/eg' *.jpg | |
# Bash commands to 0 pad (to 3 digits) numbers in .jpg filenames | |
rename 's/(\d+)(?=.*\.)/sprintf("%03d",$1)/eg' *.jpg | |
# Convert now ordered images to pdf | |
img2pdf *.jp* --output "${PWD}.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment