Date: Mon, 29 Jun 2020 16:38:40 -0700 From: Donald Wilde <dwilde1@gmail.com> To: Brandon helsley <brandon.helsley@hotmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Shell Message-ID: <CAEC7390UUq1TaiLS=tAu8jMi-cw3=k-7JPjxE4yD%2BX9_HQf5%2BA@mail.gmail.com> In-Reply-To: <CY4PR19MB0104E3F1EDD5E2EF533D9447F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> References: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB0104E3F1EDD5E2EF533D9447F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/29/20, Brandon helsley <brandon.helsley@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@gmail.com> wrote: >> >> >> On 6/29/20, Brandon helsley <brandon.helsley@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@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? * ****************************************************
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEC7390UUq1TaiLS=tAu8jMi-cw3=k-7JPjxE4yD%2BX9_HQf5%2BA>
