Running Homebrew Commands with sudo on Linux and macOS
Sometimes a command installed with Homebrew needs to be executed as root. A good example is nethogs, which needs elevated privileges to inspect network traffic. The problem is that this often fails:
1 2 | sudonethogs |
even though this works:
1 2 | nethogs |
The reason is that sudo usually runs with a different, restricted PATH. Your normal shell can find […]