find -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \;
find -name '*.rar' -exec sh -c 'mkdir "${1%.*}"; unrar e "$1" "${1%.*}"' _ {} \;
find -name '*.7z' -exec sh -c 'mkdir "${1%.*}"; 7z x "$1" -o"${1%.*}"' _ {} \;
find -name '*.tar' -exec sh -c 'mkdir -p "${1%.*}"; tar -C "${1%.*}" -xvf "$1"' _ {} \;
find -name '*.tar.gz' -or -name '*.tgz' -exec sh -c 'mkdir -p "${1%.*}"; tar -C "${1%.*}" -xvzf "$1"' _ {} \;
find -name "*.flac" -print | parallel -j 14 ffmpeg -i {} -acodec libmp3lame -ab 192k {.}.mp3 \;
find -name "*.ogg" -print | parallel -j 14 ffmpeg -i {} -c:a flac {.}.flac \;
for file in *.pdf; do
echo "Processing file: $file ..."
mkdir -p "$(basename "$file" .pdf)"
pdftoppm -png "$file" "$(basename "$file" .pdf)/page"
done
tesseract OCR on all converted Pagesfor file in */*.png; do
echo "Processing file: $file ..."
tesseract -l deu+eng "$file" "$(echo "$file" | sed 's/\.png$//g')"
done
-l deu+eng are the languages to use. In this case deu+eng means deu "Deutsch" (German) and eng "English".lowriter)find . -name '*.docx' -print0 |
while IFS= read -r -d $'\0' line; do
echo "Processing file: $line ..."
lowriter --convert-to pdf "$line" --outdir "$(dirname "$line")"
done
blkid /dev/sdXY -s UUID -o value
Where /dev/sdXY could be, /dev/sda2, /dev/nvme0n1p1, and so on.
-m LEVEL flag reduces the JPEG image quality to that level, in the example below to 95.$ jpegoptim -p --strip-com --strip-iptc -m 95 IMAGE.jpeg
# Find and optimize PNGs in parallel
$ find \( -iname '*.jpg' -or -iname '*.jpeg' \) -print0 | xargs -n1 -P6 -0 jpegoptim -p --strip-com --strip-iptc -m 95
$ jpegoptim
# Find and optimize PNGs in parallel
$ find -iname '*.png' -print0 | xargs -n1 -P6 -0 optipng -strip all -clobber -fix -o9
$ exiftool -overwrite_original -all= IMAGE1.jpeg IMAGE2.png ...
# Remove EXIF data from all `*.jpeg` files
$ find \( -iname '*.jpg' -or -iname '*.jpeg' -or -iname '*.png' \) -exec exiftool -overwrite_original -all= {} \;