Shell

Donald Wilde dwilde1 at gmail.com
Mon Jun 29 23:38:45 UTC 2020


On 6/29/20, Brandon helsley <brandon.helsley at hotmail.com> wrote:
>
>
>>
>
>
>
> In order to modify your prompt, you need to alter the variable PS1 in
>
> your .cshrc (C-shell startup file, note the starting '.') in your
>
> /root directory. For your regular prompt, look in the .profile file in
>
> /home/myuser.
>
>>
>
>
>
> .cshrc I found in the usr directory with .profile. I don't want to change
> the prompt for the usr, just for the csh shell for root. How do I do this if
> my .cshrc file is in usr directory?

You mean _user_ directory, not /usr, right?

If you log in as root, you will be using a startup file in /root. If
you su root from your regular user directory, you can copy it into
that directory.

Both are preceded by one called /etc/csh.cshrc in /etc. That is loaded
first, and the one where your regular user has /home/user is used if
you su from a normal user. The local dot-file will supercede the
master one in /etc. Get how that works? It's pretty cool once you get
used to it.

When you are operating as root, execute cd /root, then do ls -al to
see the .cshrc. Mine has the path string in it with your desired
behavior.


>
>
>
>
>
>
>
>
>
>
>>
>> On Jun 29, 2020 at 3:51 PM, Donald Wilde  <dwilde1 at gmail.com>  wrote:
>>
>>
>>  On 6/29/20, Brandon helsley  <brandon.helsley at hotmail.com>  wrote:  >   >
>>   >   >  There has been a difference in the hash sign of the command line.
>> When I'm  >  logged in as user it is $. When I am logged in as root it is
>> #, even when I  >  do not execute a shell. Usually it was root at machine17#.
>> How do I change it  >  back? I have to do pwd instead of just knowing what
>> directory I am in.  >   >  The shell used for the root user is different
>> than the shell used for a regular user, csh is leaner but also meaner than
>> sh in many ways. Do some research: man csh. You can also get more examples
>> on the web; google 'freebsd csh set prompt'. In order to modify your
>> prompt, you need to alter the variable PS1 in your .cshrc (C-shell startup
>> file, note the starting '.') in your /root directory. For your regular
>> prompt, look in the .profile file in /home/myuser. I will warn you up
>> front: the two shells are quite different. Save a backup of each of these
>> files before you alter them. If your com
> puter dumps you into shell mode without booting, having a .profile in /root
> is also a good idea. From the emergency shell you can 'source
> /home/myuser/.profile' -- Don Wilde
> **************************************************** * What is the Internet
> of Things but a system * * of systems including humans? *
> ****************************************************
>>
>


-- 
Don Wilde
****************************************************
* What is the Internet of Things but a system *
* of systems including humans?                     *
****************************************************


More information about the freebsd-questions mailing list