How to install IFTOP the right way

homebrew

I want to install IFTOP using Brew. However whenever I do it, I need to link it. The instructions given online doesn't work. It seems I need to type a PATH:(something here) every time before using IFTOP.

I'm using a 15-inch Retina Macbook Pro Late 2013. Can someone help me? I always keep my laptop updated to the latest. I don't use beta updates, if that helps.

Let me know how you can help me.

First instructions: http://macappstore.org/iftop/
Second instructions: Problem trying to install iftop via Homebrew

For the second instruction, export PATH=${PATH}:/usr/local/sbin
command has to be ran every time. Even saving to a document and linking it (as told in that link) does not make a difference.

Best Answer

/usr/local/sbin is not in your user's PATH variable. The most simple method is adding the path /usr/local/sbin to the file /private/etc/paths:

sudo nano /private/etc/paths

Modify:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

to

/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin

and save the file to disk with ctrlO and ctrlX. Then exit the shell or restart Terminal. This will change the PATH for all users.

If you want to restrict it to your user create and/or edit the file ~/.bash_profile with nano and add the line:

export PATH="/usr/local/sbin:$PATH"

Save the file to disk with ctrlO and ctrlX. Then exit the shell or restart Terminal. This will change the PATH for your user only.


To install iftop with brew from scratch in High Sierra with prerequisites (Xcode | Xcode Command Line Tools) already installed , open Terminal.app and enter:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew analytics off #optional
brew doctor #optional
brew install iftop

and add the /usr/local/sbin to the PATH as described earlier.