Posts

Showing posts from October, 2025

Why xdg-open is Irritating by Default (and How to Fix It)

  Why xdg-open is Irritating by Default (and How to Fix It) If you’ve ever tried to open a batch of files on Linux using xdg-open , you’ve probably discovered a big irritation: it doesn’t accept shell globs properly . On macOS, the open command feels natural. You can run: open *.jpg …and every JPEG in your folder pops open in your default viewer. Simple, predictable, done. On Linux, however, xdg-open — the command that sits behind the /usr/bin/open symlink on many systems — behaves differently. While it will happily open a single file, it stumbles when you throw a wildcard at it. Rather than expanding the glob and opening each file, it usually just tries (and fails) on the first one, or misinterprets the argument altogether. That makes it useless in the very situations you’d expect it to shine: folders full of images, PDFs, or text files you want to view in bulk. The Fix: Replace open with a Smarter Wrapper Fortunately, the shell itself can handle globbing. The trick...