<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing current directory of root in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093436#M7226</link>
    <description>This is not adviseable but you just need to edit the /etc/passwd file and change the home of root to /usr. whenever you type cd then it would be /usr</description>
    <pubDate>Tue, 21 Oct 2003 14:56:29 GMT</pubDate>
    <dc:creator>Dan Copeland</dc:creator>
    <dc:date>2003-10-21T14:56:29Z</dc:date>
    <item>
      <title>Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093429#M7219</link>
      <description>How can i set the current directory of root to /usr. When i say &lt;BR /&gt;#cd &lt;BR /&gt;it should go to /usr directory.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Jagadesh</description>
      <pubDate>Tue, 14 Oct 2003 23:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093429#M7219</guid>
      <dc:creator>Jagadesh</dc:creator>
      <dc:date>2003-10-14T23:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093430#M7220</link>
      <description>You want to change the home directory for the user 'root' ?  You'll need to modify /etc/passwd, changing where it says '/root' (6th field, : delimited) on the line starting with 'root:x:0:0:...' to be '/usr', write, and save.&lt;BR /&gt; &lt;BR /&gt;WARNING: Manually changing the 'passwd' file is a dangerous task.  You should make a backup of the passwd file first, and ensure you can log in ON ANOTHER SESSION prior to closing the current session.</description>
      <pubDate>Wed, 15 Oct 2003 00:04:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093430#M7220</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2003-10-15T00:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093431#M7221</link>
      <description>"cd" take syou to your HOME directory so you would need to change roots home directory which probably isn't a good idea particularly as you can't guarantee a /usr file system when you boot linux.&lt;BR /&gt; &lt;BR /&gt;Maybe your best solution is to make an alias as in &lt;BR /&gt; &lt;BR /&gt;alias "ucd=cd /usr"&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Oct 2003 00:32:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093431#M7221</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-10-15T00:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093432#M7222</link>
      <description>&lt;BR /&gt;I am not sure I understand you !&lt;BR /&gt;But if what you want is to change to an other directory then then yes alias could help you out.&lt;BR /&gt;  &lt;BR /&gt;Put this alias in one ./basbrc like ex:&lt;BR /&gt; &lt;BR /&gt;alias myr="cd /usr/root"&lt;BR /&gt; &lt;BR /&gt;this will then be there each time you start a new session.&lt;BR /&gt; &lt;BR /&gt;You could also make this as a function like ex:&lt;BR /&gt; &lt;BR /&gt;myr()&lt;BR /&gt;{&lt;BR /&gt;cd /usr/root&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;I prefer making a library of function (just a file full of functions I execute from .bashrc&lt;BR /&gt; &lt;BR /&gt;But I feel one should limit the use of alias and such because it can get very messy and you soon forget how a system mormaly reacts&lt;BR /&gt; &lt;BR /&gt;I once saw I user with more then 200 (alias, in is login that then complaind he could not control it !&lt;BR /&gt; &lt;BR /&gt;OK but one or two if it makes life easy why not.&lt;BR /&gt;   &lt;BR /&gt;Hope this helps&lt;BR /&gt; &lt;BR /&gt;J-P&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Oct 2003 05:29:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093432#M7222</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2003-10-15T05:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093433#M7223</link>
      <description>Hello Jagadesh,&lt;BR /&gt;&lt;BR /&gt;if this is a serious problem for you, then you might just use the root account for too much of your daily work. Most of the time you should be able to use a normal account and there you can set your home to whatever you like without any risk to system integrity.&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin</description>
      <pubDate>Wed, 15 Oct 2003 12:04:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093433#M7223</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2003-10-15T12:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093434#M7224</link>
      <description>If you want to do this without changing the root home directory, you can do this on a shell-by-shell basis simply by:&lt;BR /&gt;&lt;BR /&gt;HOME=/usr&lt;BR /&gt;export HOME&lt;BR /&gt;&lt;BR /&gt;Then for that shell only, when you type "cd" you will go where you want.  Cron jobs, other scripts, etc, will not be affected.</description>
      <pubDate>Fri, 17 Oct 2003 13:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093434#M7224</guid>
      <dc:creator>Nat Guyton</dc:creator>
      <dc:date>2003-10-17T13:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093435#M7225</link>
      <description>or you could add another user to the password file with UID 0, so root's home would be unchanged but this new user would have root access too and a different home dir.</description>
      <pubDate>Mon, 20 Oct 2003 04:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093435#M7225</guid>
      <dc:creator>Patrick Van Humbeeck</dc:creator>
      <dc:date>2003-10-20T04:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing current directory of root</title>
      <link>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093436#M7226</link>
      <description>This is not adviseable but you just need to edit the /etc/passwd file and change the home of root to /usr. whenever you type cd then it would be /usr</description>
      <pubDate>Tue, 21 Oct 2003 14:56:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/changing-current-directory-of-root/m-p/3093436#M7226</guid>
      <dc:creator>Dan Copeland</dc:creator>
      <dc:date>2003-10-21T14:56:29Z</dc:date>
    </item>
  </channel>
</rss>

