Yeah this is OK, but running macOS commands for Linux deployments doesn't work all the time. What about `lsblk` or `ip`? Also md5 vs md5sum. Also and I don't have macOS handy to try it, I'm pretty sure grep has differing options. I can't count how many times friends and colleagues who use macOS for development have put BSD commands into Dockerfiles and CI pipelines and have wondered why it didn't work.

Your criticism is valid, but its possible to get compatibility between macOS (or another BSD) and Linux. GNU utilities are already mentioned but there's also, for example,

> What about `lsblk` or `ip`?

For a (partly compatible) equivalent to ip I can recommend iproute2mac [1]. You can also use the old utilities from BSD (ifconfig, route, etc) or the GUI.

For lsblk I found no drop-in replacement, just equivalents [2]

On top of that, Nix works on Linux and macOS.

[1] https://github.com/brona/iproute2mac

[2] https://apple.stackexchange.com/questions/107953/list-all-de...

[3] https://nixos.org