Date: Tue, 30 Jun 2020 14:24:15 +0200 From: Polytropon <freebsd@edvax.de> To: Brandon helsley <brandon.helsley@hotmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Shell Message-ID: <20200630142415.e3897aa9.freebsd@edvax.de> In-Reply-To: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> References: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 29 Jun 2020 15:14:43 -0600, Brandon helsley 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. After loggin in, a shell is _always_ executed (the so-called login shell). On FreeBSD, the default is the C shell, but maybe you have chosen a different shell? You can always check your actual login shell with the following command: echo $SHELL You can check what prompt is defined (see below). > 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. This depends on _which_ shell you are using. On FreeBSD, there are the following possibilities: /bin/sh - typically used for scripting or single-user mode /bin/csh - default dialog shell, primarily for interactive use. If you only get # and $ as a prompt character, it seems that you accidentally changed from /bin/csh to /bin/sh. You now have two options: 1. Start csh manually by entering "csh". 2. Change back to the C shell as login shell by entering the command "chsh" (change shell) and change /bin/sh to /bin/csh. I would prefer number 2. ;-) After making that change, you can check if the prompt is now set correctly: In /bin/sh, use: echo $PS1 in /bin/csh, use: echo $prompt The second command should list a more complex string. Note that the C shell per default uses # and % instead of # and $ (like sh and bash and zsh) to differentiate between root and non-root users. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200630142415.e3897aa9.freebsd>