New answers tagged

0

The most obvious place for personal information is under /home, but there may be private information elsewhere, such as: In logs (IP addresses, email addresses, etc.) In email (/var/mail) In the printer spooler (/var/spool/cups) Under /etc (e.g. network configuration) In deleted files that can be carved out of the disk image (This is not an exhaustive list!...


0

To convert multiple jpg to webp, using cwebp: find ./ -name "*.jpg" -exec cwebp -q 70 {} -o {}.webp \ Thunar Custom Action: for file in %F; do cwebp "$file" -o "${file%%.*}".webp; done Thunar Custom Action, moving webp images to subfolder: mkdir %d/webp && cd %d; for file in %N; do cwebp "$file" -o "webp/${file%%.*}".webp; done Cwebp's default ...


0

This solution will also work. The last part of the code (mv "$img" ./lowpixel) will move files below a specified width and height to a folder. In the following example all jpg images lower than 300x300 will be moved to a folder named lowpixel: find -iname \*.jpg | while read img; do anytopnm "$img" | pamfile | perl -ane 'exit 1 if $F[3]<300 || $F[5]<...


3

A traditional tool for printing simple text files is enscript. This produces PostScript output. You can convert this to an image in many ways. One that gives good results is pdftopng which needs the PostScript packaged into a pdf as input (eg with ps2pdf) and produces png image files. So, using convert from ImageMagick to convert to jpg you end up with: ...


3

Using identify from ImageMagick: #! /bin/sh identify -format '%w %h %i\n' -- "$@" 2>/dev/null | \ while read W H FN; do if [ $W -gt $H ]; then echo mv -f -- "$FN" /path/to/landscape/ else echo mv -f -- "$FN" /path/to/portraits/ fi done This is not ...


3

You could use imagemagick's identify with the fx special operator to compare height and width e.g. h>w. If true it will output 1, if false it will output 0: for f in ./*.jpg do r=$(identify -format '%[fx:(h>w)]' "$f") if [[ r -eq 1 ]] then mv "$f" /path/to/portraits else mv "$f" /path/to/landscapes fi done With zsh you could ...


3

This uses the fileinfo utility to get an image's width and height. If the height is greater than the width, the file is moved to the portraits/ directory. If not, it is moved to the landscape/ directory. for f in ./*jpg do if fileinfo "$f" 2>&1 | awk '/w =/{w=$3+0; h=$6+0; if (h>w) exit; else exit 1}' then mv "$f" portraits/ ...


1

As an alternative, you can do this using only POSIX: find . -type f -name "*.jpg" -exec du -sk {} \; | awk 'BEGIN{total=0};{total += $1}; END{printf "%.3f MB\n", total / 1024}' Further reading: du - estimate file space usage (POSIX) find - find files (POSIX)


4

find ./path/to/your/drive -type f -name '*.jpg' -exec du -ch {} + Or much faster find /path/to/your/drive -name "*.jpg" -print0 | du -ch --files0-from=- Or simply, du -ch /path/to/your/drive/*.jpg | grep total Or with help of awk, find /path/to/your/drive -iname "*.jpg" -ls | awk '{total += $7} END {print total}' On my system file size shows on ...



Top 50 recent answers are included