Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am not sure exactly what happned but the root prompt in terminal session has been changed from
[root@localhost]#
to
bash-3.1#.
I changed the Shell from bash to sh (I read on the forum that it is not recommended to have the root shell set on bash, not quite sure what it means - very new in linux). Now the prompt of course is saying
sh-3.1#
I would need to ask what could have happened and do I need to change it and how can I change it?
The only thing you shouldn't be doing is to be logged in and work
as root - which shell you're using won't make much difference in
Linux, since sh is just a symlink to bash on pretty much all distros.
The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.
The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.
It does make a difference in Solaris, the sh root uses there
is a statically linked executable, and not just a symlink to a
different shell. The advantage is that even if /lib or /usr/lib
were on separate file-systems and their mounting failed for
some reason you'd still have a shell :} (or something like that -
it's been a while that I was on my course, and never had any
issues that would warrant a closer examination since).
It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:
If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add...
It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:
Quote:
If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add...
Yeah, but you will still be using bash even though its mimicking sh behaviour. On FreeBSD and Solaris, sh is a totally different shell to bash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.