My PATH Variable is a Mess

<h1>Introduction</h1> <p>When you install a program, it often asks you to add a PATH to your shell config file. I do it blindly thinking, &ldquo;This tool is cool. I want to use it NOW!&rdquo; After some time you find your PATH variable is a mess. A lot of duplication or triplication of PATHs. It is time to clean it up.</p> <h1>Check your PATH</h1> <p>The following command substitutes colons with new lines, sorts, counts the number of unique PATH occurrences, and displays:</p> <pre> $ echo $PATH | sed &#39;s/:/\n/g&#39; | sort | uniq -c</pre> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:686/1*COrZDJ3gYPhSiOipVNCvDA.png" style="height:480px; width:686px" /></p> <p>The part of my output from echo $PATH | sed &lsquo;s/:/\n/g&rsquo; | sort | uniq -c. Image by Author.</p> <p>Do you have any PATH more than once? If so, read on!</p> <p><a href="https://towardsdatascience.com/my-path-variable-is-a-mess-e52f22bfa520"><strong>Website</strong></a></p>
Tags: path variable