↑ ↓ select, Enter open, Esc close

Find images containing GPS coordinates

Adjust the values, the command updates live
user@server
exiftool -r -ext jpg -ext jpeg -if '$gpslatitude' -p '$directory/$filename' /var/www/vhosts/example.com/httpdocs/wp-content/uploads 2>/dev/null

Checks every JPEG for a GPS latitude and prints only the paths of the matches. Smartphone photos often contain the exact location, which is a privacy problem for photos of homes or employees. The files found can then be cleaned up selectively.

Note: Package libimage-exiftool-perl. At the end, exiftool reports the number of files that did not meet the condition.

Also searched as

  • find photos with location data
  • check images for gps exif
  • do my uploads reveal where photos were taken
  • search exif gps data linux

Remove EXIF and other metadata from images

$exiftool -r -ext jpg -ext jpeg -all= -overwrite_original /var/www/vhosts/example.com/httpdocs/wp-content/uploads
destructiveImages and performance

Check Cache-Control of all CSS, JS and image files on a page

$curl -s https://example.com/ | grep -oE '(src|href)="[^"]+\.(css|js|woff2?|jpe?g|png|gif|webp|avif|svg)(\?[^"]*)?"' | cut -d'"' -f2 | sed -E 's#^//#https://#; s#^/#https://example.com/#' | grep '^http' | sort -u | while read -r a; do printf '%-45s %s\n' "$(curl -sI "$a" | grep -i '^cache-control:' | tr -d '\r')" "$a"; done
harmlessImages and performance

Check HTTP/3 support via the Alt-Svc header

$curl -sI https://example.com/ | grep -i '^alt-svc'
harmlessImages and performance

Compare the response time of a PHP page with a static file

$for u in https://example.com/ https://example.com/wp-includes/css/dist/block-library/style.min.css; do curl -o /dev/null -s -w "%{time_starttransfer}s TTFB $u\n" "$u"; done
harmlessImages and performance

Convert images to AVIF recursively

$find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) -exec sh -c 'for f; do [ -e "$f.avif" ] || avifenc -s 6 "$f" "$f.avif" >/dev/null; done' sh {} +
cautionImages and performance

Convert images to WebP recursively

$find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) -exec sh -c 'for f; do [ -e "$f.webp" ] || cwebp -quiet -q 80 "$f" -o "$f.webp"; done' sh {} +
cautionImages and performance

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.