One-Liner Shell Command

coding · GPT-4o · free

I want a one liner shell command that [DESCRIBE OUTCOME] . Deliver it, then teach me why it works. Environment: Shell: [bash / zsh / fish / POSIX sh] OS: [macOS / Linux distro / WSL] Tools available: [DEFAULT / rg / jq / fd / gh / fzf / OTHER] Files or input to operate on: [DESCRIBE OR PASTE SAMPLE] Deliver: 1. The one liner — copy paste ready, no placeholders left 2. A word by word breakdown: what each flag does and why chosen over alternatives 3. The failure modes: filenames with spaces, newlines in names, huge output, permission errors 4. The dry run / preview version to run first if it's destructive 5. Portability notes: if it's GNU only (sed i'', xargs r), tell me the BSD/macOS equivalent 6. The moment this stops being a one liner and should become a script Rules: No curl | bash chains Prefer find print0 | xargs 0 over globs when filenames can be weird Quote every variable If awk beats the pipe golf, use awk

#shell #bash #one-liners