Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisione Revisione precedente Prossima revisione | Revisione precedente Ultima revisione Entrambe le parti successive la revisione | ||
notes:linux.tips.and.tricks [08/08/2017 22:18] alez [PDF tools] |
notes:linux.tips.and.tricks [27/03/2023 23:12] alez [PDF tools] |
||
---|---|---|---|
Linea 1: | Linea 1: | ||
====== Linux Tips & Tricks ====== | ====== Linux Tips & Tricks ====== | ||
+ | ===== Bash tricks for manipulating files ===== | ||
+ | |||
+ | Move all files matching certain pattern from subdirectories in another single target folder: | ||
+ | <code>find . -iname '*.jpg' -exec mv {} ../target/ \;</code> | ||
+ | |||
+ | Remove all files matching certain pattern in here and in all subdirectories: | ||
+ | <code>find . -iname "*.poo" -exec rm -r "{}" \;</code> | ||
+ | |||
+ | Remove all empty subdirectories in here: | ||
+ | <code>find . -depth -type d -empty -exec rmdir "{}" \;</code> | ||
+ | |||
+ | |||
+ | ===== disk UUID's ===== | ||
+ | |||
+ | Get complete info about partitions, type and if mounted: | ||
+ | |||
+ | <code>lsblk -f</code> | ||
+ | |||
+ | Also useful: | ||
+ | |||
+ | <code>blkid -s UUID -o value /dev/sda</code> | ||
+ | |||
+ | |||
+ | |||
===== PDF tools ===== | ===== PDF tools ===== | ||
+ | |||
+ | Lower file-size (quality) of a pdf document | ||
+ | |||
+ | <code>gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf</code> | ||
+ | ''-dPDFSETTINGS=/screen'' for even lower size/quality | ||
+ | |||
+ | pdfjoin , no rotate | ||
+ | |||
+ | <code>pdfjoin --rotateoversize false</code> | ||
two a5 in one a4 | two a5 in one a4 | ||
<code>pdfnup a5.pdf a5.pdf --nup '2x1' </code> | <code>pdfnup a5.pdf a5.pdf --nup '2x1' </code> | ||
+ | Note: ''pdfnup'' is part of ''texlive-extra-utils'' package | ||
overlay a "draft" or other watermark... | overlay a "draft" or other watermark... | ||
Linea 13: | Linea 47: | ||
<code>gs -o output.pdf -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 input.pdf</code> | <code>gs -o output.pdf -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 input.pdf</code> | ||
+ | |||
+ | join and rotate | ||
+ | |||
+ | <code>pdfjam --outfile out.pdf --landscape --angle 90 input1.pdf input2.pdf</code> | ||
===== Reset keyboard ===== | ===== Reset keyboard ===== | ||
Linea 142: | Linea 180: | ||
$ kill -USR1 $pid; sleep 1; kill $pid'' | $ kill -USR1 $pid; sleep 1; kill $pid'' | ||
- | You can add “watch” to this one: | + | You can add "watch" to this one: |
1) find $pid for you dd process: | 1) find $pid for you dd process: | ||
Linea 153: | Linea 191: | ||
Someone suggested to give a look to http://www.ivarch.com/programs/pv.shtml | Someone suggested to give a look to http://www.ivarch.com/programs/pv.shtml | ||
+ | == Or: (definitely best solution) == | ||
+ | ''$ dd if=/dev/zero of=/dev/null& bs=1M status=progress'' | ||
===== rsync quick ref ===== | ===== rsync quick ref ===== | ||