PDF Frontpage to jpg

First find all the files you want to convert and store their filenames in a file

find my-pdf-folder/ -type f -name "*.pdf" > pdffiles.txt

Iterate through that files and make a jpeg from them

while read -r LINE; do pdftoppm -f 1 -singlefile -jpeg "$LINE" "$LINE"; done < pdffiles.txt

Finally move all jpgs to a separate location if necessary

find my-pdf-folder/ -type f -name "*.jpg" -exec mv {} jpgs/ \;


how to detect space usage in linux

Getting the size of all files and folders inside the current directory can be done by typing:

 ls | xargs du -s -BM

Get filesize in descending order from all files in a recursive folder structure

find . -type f -exec du -a -h --max-depth=100 {} + | sort -hr

Another quite handy tool is ncdu. It provides you the disc usage in a graphical way on the shell. Install it like this:

sudo apt-get install ncdu

List folders bigger 1Mb and list them in descending order

du -sm * | awk '$1 > 1' | sort -n -r

List the ten largest folders inside a recursive folder structure

find . -type d -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}