How to clean duplicate $PATH entries

hakerdefo

Open terminal and type,

echo $PATH


Do you see any duplicate path entries? If no, Great! If yes, Worry not! Fix is simple!
Open  '.bashrc' file in your favorite text-editor and just add following lines at the bottom,


PATH="$(echo $PATH | perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, scalar <>))')"
export PATH


Save the file. Do Logout-Login and voila! No more duplicate path entries!
Cheers!!!
You Can't Always Git What You Want

Snap