<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Learn How to Set Your $PATH Variables Permanently in Linux	</title>
	<atom:link href="https://www.tecmint.com/set-path-variable-linux-permanently/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/set-path-variable-linux-permanently/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Wed, 03 Jan 2024 14:52:37 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Roopid		</title>
		<link>https://www.tecmint.com/set-path-variable-linux-permanently/comment-page-1/#comment-2122067</link>

		<dc:creator><![CDATA[Roopid]]></dc:creator>
		<pubDate>Wed, 03 Jan 2024 14:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=20051#comment-2122067</guid>

					<description><![CDATA[Here&#039;s my solution, after reading a lot of conflicting advice. Some people say put &lt;strong&gt;$PATH&lt;/strong&gt; changes in .&lt;code&gt;bash_profile&lt;/code&gt; (which doesn&#039;t run for a bash shell run from the desktop). Some say put them &lt;code&gt;.bashrc&lt;/code&gt; (which does run, probably more than once).

If I simply add a line in &lt;code&gt;.bashrc&lt;/code&gt; (I mean &lt;strong&gt;/home/roopid/.bashrc&lt;/strong&gt;):
&lt;pre&gt;
export PATH=&quot;$PATH:/home/roopid/source/rexx:.&quot;
&lt;/pre&gt;
Then it gets added twice, which has caused problems when &lt;code&gt;&quot;.&quot;&lt;/code&gt; is not the last item (I never found out why).

So I use this, which checks whether my changes have already been made:
&lt;pre&gt;
if ! [[ &quot;$PATH&quot; =~ &quot;source/rexx&quot; ]]
then
    PATH=&quot;$PATH:$HOME/source/rexx:.&quot;
fi
&lt;/pre&gt;
It adds 2 directories, one for &lt;strong&gt;Rexx&lt;/strong&gt; scripts I use for admin tasks, and &lt;code&gt;&quot;.&quot;&lt;/code&gt; because I like to include the current directory for commands.

Whole file included below for completeness:-
&lt;pre&gt;
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific environment
if ! [[ &quot;$PATH&quot; =~ &quot;$HOME/.local/bin:$HOME/bin:&quot; ]]
then
    PATH=&quot;$HOME/.local/bin:$HOME/bin:$PATH&quot;
fi

# Check changes by me (roopid) have not already been made
if ! [[ &quot;$PATH&quot; =~ &quot;source/rexx&quot; ]]
then
    PATH=&quot;$PATH:$HOME/source/rexx:.&quot;
fi


export PATH

# Uncomment the following line if you don&#039;t like systemctl&#039;s auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
	for rc in ~/.bashrc.d/*; do
		if [ -f &quot;$rc&quot; ]; then
			. &quot;$rc&quot;
		fi
	done
fi

unset rc
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my solution, after reading a lot of conflicting advice. Some people say put <strong>$PATH</strong> changes in .<code>bash_profile</code> (which doesn&#8217;t run for a bash shell run from the desktop). Some say put them <code>.bashrc</code> (which does run, probably more than once).</p>
<p>If I simply add a line in <code>.bashrc</code> (I mean <strong>/home/roopid/.bashrc</strong>):</p>
<pre>
export PATH="$PATH:/home/roopid/source/rexx:."
</pre>
<p>Then it gets added twice, which has caused problems when <code>"."</code> is not the last item (I never found out why).</p>
<p>So I use this, which checks whether my changes have already been made:</p>
<pre>
if ! [[ "$PATH" =~ "source/rexx" ]]
then
    PATH="$PATH:$HOME/source/rexx:."
fi
</pre>
<p>It adds 2 directories, one for <strong>Rexx</strong> scripts I use for admin tasks, and <code>"."</code> because I like to include the current directory for commands.</p>
<p>Whole file included below for completeness:-</p>
<pre>
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi

# Check changes by me (roopid) have not already been made
if ! [[ "$PATH" =~ "source/rexx" ]]
then
    PATH="$PATH:$HOME/source/rexx:."
fi


export PATH

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
	for rc in ~/.bashrc.d/*; do
		if [ -f "$rc" ]; then
			. "$rc"
		fi
	done
fi

unset rc
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Todd		</title>
		<link>https://www.tecmint.com/set-path-variable-linux-permanently/comment-page-1/#comment-1185784</link>

		<dc:creator><![CDATA[Todd]]></dc:creator>
		<pubDate>Sat, 29 Jun 2019 18:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=20051#comment-1185784</guid>

					<description><![CDATA[@Ryan 

When setting up the Android &#038; Java SDKs on this system I had the same issue when defining the needed PATH variables and adding the library paths. I dug around and found that my current system has both &lt;strong&gt;~/.bashrc&lt;/strong&gt; and &lt;strong&gt;/etc/profile&lt;/strong&gt; and that no matter what I tried defining them in &lt;strong&gt;~/.bashrc&lt;/strong&gt; &#038; it wasn&#039;t working, but commenting the lines out in &lt;strong&gt;~/.bashrc&lt;/strong&gt; and copying them to &lt;strong&gt;/etc/profile&lt;/strong&gt; did exactly as expected.

I came to the conclusion that perhaps there&#039;s an overwrite happening, but I&#039;ve never had a chance to understand it further.]]></description>
			<content:encoded><![CDATA[<p>@Ryan </p>
<p>When setting up the Android &amp; Java SDKs on this system I had the same issue when defining the needed PATH variables and adding the library paths. I dug around and found that my current system has both <strong>~/.bashrc</strong> and <strong>/etc/profile</strong> and that no matter what I tried defining them in <strong>~/.bashrc</strong> &amp; it wasn&#8217;t working, but commenting the lines out in <strong>~/.bashrc</strong> and copying them to <strong>/etc/profile</strong> did exactly as expected.</p>
<p>I came to the conclusion that perhaps there&#8217;s an overwrite happening, but I&#8217;ve never had a chance to understand it further.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ryan		</title>
		<link>https://www.tecmint.com/set-path-variable-linux-permanently/comment-page-1/#comment-1184907</link>

		<dc:creator><![CDATA[Ryan]]></dc:creator>
		<pubDate>Sat, 29 Jun 2019 00:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=20051#comment-1184907</guid>

					<description><![CDATA[Hello,

I am trying to change my &lt;code&gt;$PATH&lt;/code&gt; and i did a &lt;strong&gt;vi&lt;/strong&gt; on &lt;strong&gt;.bash_profile&lt;/strong&gt; where i added this command:
&lt;pre&gt;
export PATH=$PATH:/HOME/scripts
&lt;/pre&gt;
Then I saved the file and then i did a source &lt;strong&gt;~/.bashrc&lt;/strong&gt;, but my scripts file did not show up when i ran this command.
&lt;pre&gt;
$ echo $PATH
&lt;/pre&gt;
WHAT did i do wrong? Respectfully request your help.

Thank you.
cajunchief]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>I am trying to change my <code>$PATH</code> and i did a <strong>vi</strong> on <strong>.bash_profile</strong> where i added this command:</p>
<pre>
export PATH=$PATH:/HOME/scripts
</pre>
<p>Then I saved the file and then i did a source <strong>~/.bashrc</strong>, but my scripts file did not show up when i ran this command.</p>
<pre>
$ echo $PATH
</pre>
<p>WHAT did i do wrong? Respectfully request your help.</p>
<p>Thank you.<br />
cajunchief</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shima		</title>
		<link>https://www.tecmint.com/set-path-variable-linux-permanently/comment-page-1/#comment-1151396</link>

		<dc:creator><![CDATA[Shima]]></dc:creator>
		<pubDate>Mon, 13 May 2019 17:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=20051#comment-1151396</guid>

					<description><![CDATA[Hi,

My system is Fedora 28 and the default shell is &lt;strong&gt;tcsh&lt;/strong&gt;. I want to know how can I set permanent PATH? It is necessary to say that I do not have root access.

Before, I had Ubuntu, the default shell was &lt;strong&gt;BASH&lt;/strong&gt;. So I used to edit &lt;strong&gt;.bashrc&lt;/strong&gt; file.

Thanks,
Shima]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>My system is Fedora 28 and the default shell is <strong>tcsh</strong>. I want to know how can I set permanent PATH? It is necessary to say that I do not have root access.</p>
<p>Before, I had Ubuntu, the default shell was <strong>BASH</strong>. So I used to edit <strong>.bashrc</strong> file.</p>
<p>Thanks,<br />
Shima</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: chk666		</title>
		<link>https://www.tecmint.com/set-path-variable-linux-permanently/comment-page-1/#comment-1001069</link>

		<dc:creator><![CDATA[chk666]]></dc:creator>
		<pubDate>Sun, 03 Jun 2018 22:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=20051#comment-1001069</guid>

					<description><![CDATA[Hello and good days.

I need help what happened if i run &lt;strong&gt;virtualenv&lt;/strong&gt; in my  environment path, what i mean is &quot;&lt;strong&gt;chk@waklu:$ virtualenv&lt;/strong&gt;&quot; did the path environment is change on &lt;strong&gt;bashrc&lt;/strong&gt;, &lt;strong&gt;profile&lt;/strong&gt;, or even in the &lt;strong&gt;/etc/bash&lt;/strong&gt;, &lt;strong&gt;/etc/profile&lt;/strong&gt;.

The problem is, I cannot detect my python and when i try to echo path should get &lt;strong&gt;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/marin/bin&lt;/strong&gt;
but I am getting blank, not showing up. Need help I run 16.04 Ubuntu.]]></description>
			<content:encoded><![CDATA[<p>Hello and good days.</p>
<p>I need help what happened if i run <strong>virtualenv</strong> in my  environment path, what i mean is &#8220;<strong>chk@waklu:$ virtualenv</strong>&#8221; did the path environment is change on <strong>bashrc</strong>, <strong>profile</strong>, or even in the <strong>/etc/bash</strong>, <strong>/etc/profile</strong>.</p>
<p>The problem is, I cannot detect my python and when i try to echo path should get <strong>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/marin/bin</strong><br />
but I am getting blank, not showing up. Need help I run 16.04 Ubuntu.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
