To use STDBUF from Homebrew's coreutils I run brew search stdbuf and get 

No formula found for "stdbuf".
Searching pull requests...
Closed pull requests:
coreutils: upstream fix for stdbuf (https://github.com/Homebrew/homebrew/pull/32955)


I run brew install coreutils but get Warning: coreutils-8.23_1 already installed. 

I do but see no stdbuf in my system.

$ std [tab]
stdethers  stdhosts   


My PATH is 

/usr/local/bin:/usr/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:
/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/Users/masi/.cabal/bin


Uninstall Macports

Using Macports and Homebrew together cause conflicts. 
Final solution is to uninstall Macports which is immature. 
Regardless of what your PATH is, Macports causes conflicts with programs in the PATH. 
I realised the core of the problem here at the end of the body about How to Enlarge Disk Image in VirtualBox?



How can you use stdbuf in OSX Yosemite?
coreutils on OS X adds the prefix g to all the commands so as to not mess up with default programs on OS X.

It prints this when you run brew install coreutils

==&gt; Caveats
All commands have been installed with the prefix 'g'.

If you really need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:

    PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"


So unless you really need to use it as stdbuf, there is no real reason to update your path, you can simply run gstdbuf instead:

$ gstdbuf --help                                                         
Usage: gstdbuf OPTION... COMMAND