Articles

Image Processing commands

Conversion Convert several files from a format to another: 1$ convert img_*.bmp img_%04d.png Resize Resize images of the current folder to progressive jpeg. Resized images will not be greater than 600x600, but the aspect ratio will be respected: 1$ convert -resize 600x600 -sharpen 1 -interlace Line ./* ./pict …
➟ Read more

PDF commands

Case-insensitive search of a string in a PDF, thanks to pdfgrep  : 1$ pdfgrep --page-number --ignore-case 'my_string' ./document.pdf Convert a PDF to a JPEG file at 150 dpi: 1$ convert -density 150 ./document.pdf ./document.jpg Extract images from a PDF document: 1$ pdfimages -j document.pdf prefix Compile all …
➟ Read more

Text, Date & Document processing commands

Search Count the number of lines with at least one occurrence of the y character: 1$ cat test.txt 2asd dd :; > 3y YYYyy yyy 4 . 5 6asdkjlyes 7 kjkjhkjhy 8 9$ grep -o '.*y.*' ./test.txt | wc -l 103 Replace Text replacement: 1$ sed 's/string …
➟ Read more

Hardware commands

Computer Get Mac hardware model: 1$ sudo dmidecode -s system-product-name 2MacBookAir5,2 Disk Show all S.M.A.R.T. info of a disk: 1$ smartctl -a /dev/ada4 Low-level format of the hda device: 1$ dd if=/dev/zero of=/dev/hda Same as above but for paranoΓ―d …
➟ Read more

RPM, Urpmi & Yum commands

RPM List all installed packages: 1$ rpm -qa Get the list of all installed packages and their architecture: 1$ rpm -qa --queryformat "%-40{NAME} %-8{ARCH}\n" Same as above, but show i586 packages only: 1$ rpm -qa --queryformat "%-40{NAME} %-8{ARCH}\n" | grep i586 Downgrade a package to …
➟ Read more