Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 2020 15:10:16 +0000 (UTC)
From:      davidson@freevolt.org
To:        Brandon helsley <brandon.helsley@hotmail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Shell
Message-ID:  <alpine.DEB.2.21.2006301506140.9735@azone.org>
In-Reply-To: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>
References:  <> <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>

index | next in thread | previous in thread | raw e-mail

On Mon, 29 Jun 2020 Brandon helsley wrote:
>
>
> There has been a difference in the hash sign of the command
> line.

If by "hash sign" you mean the '#' character, then (by convention) no
non-root user should have such a prompt.

'#' is for root alone.

> When I'm logged in as user it is $.

This sounds like it could be a normal non-root user whose shell is
/bin/sh.

When logged in as that user, you can see what default shell they have
like so:

  $ finger `whoami`
  Login: poe            Name: little red riding hood
  Directory: /home/poe  Shell: /bin/sh
  [...]                 ^^^^^  ^^^^^^^

If the shell is /bin/sh, then the configuration file for that user's
shell is in ~/.shrc. You might be able to set the prompt to something
more helpful by uncommenting some lines in that file.

Uncomment these lines, for example:

  $ cat ~/.shrc
  [...]
  # # set prompt; ``username@hostname$ ''
  # PS1="`whoami`@`hostname | sed 's/\..*//'`"
  # case `id -u` in
  # 	 0) PS1="${PS1}# ";;
  #       *) PS1="${PS1}$ ";;
  # esac

When you've uncommented the lines, you can either log out and back in
again, or just do

  $ . ~/.shrc

to re-read the configuration, and hopefully see a prompt like

  poe@machine$

instead.

> When I am logged in as root it is #, even when I do not execute a
> shell.

Is it possible you booted into single-user mode? That is what I would
expect to see from /bin/sh in single-user mode.

After boot messages, did you see a query prompt like

   "Enter full pathname of shell or RETURN for /bin/sh:"

and then get your bare '#' prompt?

> 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.


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.DEB.2.21.2006301506140.9735>