brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: killall -s shows which processes it would kill before it does

Terminal
~/tips/tip-macos-killall-s-preview

killall -s Finder

Previews which processes a killall command would hit without sending any signal.

killall on a Mac kills processes by name, which is great until a name matches more than you thought. Before I send a signal to something by name, I like to see the list first.

The -s option shows what would be done without sending any signal:

killall -s Finder

It prints what it would do to which process, and nothing actually happens. Happy with the list? Run the same command without -s. The -d option is similar and prints the list of processes that will get the signal, or a message that nothing matched.

Where this matters most is with -m, which treats the name as a case-sensitive regular expression. That is handy for apps with many helper processes, and also how you hit far more than intended:

killall -s -m 'Helper'

The man page itself warns that a single dot as pattern matches every process running under your user ID. With -s in front you see that mistake on screen instead of watching your apps close.

My advice is to make -s a habit for any killall you type by hand, and to keep the default TERM signal unless a process really refuses to quit. -9 gives the app no chance to save anything.

The caveat: the preview is a snapshot. Processes can start or stop between the dry run and the real command, so the list you saw is not a promise. For something that keeps restarting itself through launchd, killing it will not help anyway; that is a job for launchctl.

Further reading: killall man page (ss64)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link