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 don't think that there is any way to change the symbol in the terminal prompt. I think that the default prompt is your only option. However, you might want to contact the maker of distribution, if anyone knows, they do.
in order to change the (bash) shell prompt, in Debian you can edit /etc/bash.bashrc and modify the PS1 variable like this:
Code:
PS1='${debian_chroot:+(debian_chroot)}# '
In general, this should also work:
Code:
PS1='# '
Otherwise, modifying PS1 in /etc/profile will affect other shells as well, but at least in Debian the value is taken from /etc/bash.bashrc anyway.
Both files will change the prompt system-wide, but will be overridden if PS1 is set differently in /home/<user>/.bashrc.
EDIT: For user-specific settings .bashrc is the file you want to edit. This is valid for /root/.bashrc as well, which AFAIK is the best way to go if you wish to affect the root prompt and nothing else.
Kind regards,
Philip
Last edited by Philip Lacroix; 04-19-2013 at 09:16 AM.
Regarding ~/.bash_profile in Debian, I'm slightly confused. It used to be the configuration file for login shells, and it still is according to the bash man page:
Code:
/etc/profile
The systemwide initialization file, executed for login shells
/etc/bash.bashrc
The systemwide per-interactive-shell startup file
~/.bash_profile
The personal initialization file, executed for login shells
~/.bashrc
The individual per-interactive-shell startup file
However, in Debian Squeeze (bash 4.1) and Wheezy (bash 4.2) I don't see any ~/.bash_profile, so I guess login shells are handled by /etc/profile by default. Besides, /etc/profile reads /etc/bash.bashrc (system-wide configuration for non-login shells) if it exists. With this setup, as far as I can see, ~/.bashrc affects login shells as well, unless ~/.bash_profile is available.
This is not valid for Slackware (and probably for many other distributions) where ~/.bashrc and ~/.bash_profile have their original behavior, while /etc/profile is for system-wide configuration affecting login shells. Moreover, /etc/bash.bashrc is not there and not even mentioned in the man page (while it is in Debian's version), so I guess this file is a Debian "fix"?
Kind regards,
Philip
Last edited by Philip Lacroix; 04-22-2013 at 04:46 PM.
The files under /etc are read first, then the user's personal files, which can override the global settings.
You may have to create the local/personal bash files.
This is not valid for Slackware (and probably for many other distributions) where ~/.bashrc and ~/.bash_profile have their original behavior, while /etc/profile is for system-wide configuration affecting login shells. Moreover, /etc/bash.bashrc is not there and not even mentioned in the man page (while it is in Debian's version), so I guess this file is a Debian "fix"?
Yes, each distribution has its own idiosyncrasies. The bottom line is that a the lack of a file file, be it system wide or per-user, is silently ignored. At one time a per user startup file was probably included in /etc/skel so that each user had one upon creation, and it was later deemed unnecessary.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.