Alright solutions for common-ish problems
Click a snippet to select-all thanks to the magic of CSS.
Find…
…a string in all files within a directory
grep -ri "string" /path/to/directory
- Case insensitive
- Recursive
…and remove all of a filetype (JPG) within a directory
find . -name "*.jpg" -type f -exec rm {} +
- Recursive
Batch…
…rename all PNGs sequentially ordered by modification time
i=1; for file in $(ls -tr *.png); do mv "$file" "$i.png"; i=$((i+1)); done
…combine all PDFs into one
pdftk *.pdf cat output combined.pdf
…create directories “00” to “99”
mkdir {00..99}
Export…
…all installed apt packages to a list
dpkg --get-selections > pkgs.list
Import…
…a list of apt packages to installed
dpkg --set-selections < pkgs.list