Make sudo use current user’s $PATH

To do this, setup an alias for sudo in ~/.bashrc:

alias sudo='sudo env PATH=$PATH'

Credits to pixelbeat at Stackoverflow


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.