Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Hello community!
I've got a question... I want to edit the prompt colors permanently. I've already edited the file /etc/bash.bashrc, which is the "globally bashrc". It work's already fine, but I don't want to send the command "source /etc/bash.bashrc" after each login, relogg or something else.
I want this prompt-configuration always on each user account. Is it possible to realize that and if yes: How?!
Putting it in .bash_profile should work. .bash_profile is always loaded, while .bashrc is only loaded in special circumstances (something related to "login shells", IIRC).
BTW, which distribution are you using, that doesn't put a .bash_profile or .bashrc in all newly created accounts?
If you want the same prompt to be in all new accounts, then put the .bash_profile and/or.bashrc file(s) in /etc/skel.
Last edited by dugan; 07-23-2012 at 08:48 AM.
Reason: .bash_profile/.bashrc was a bit confusing
Thank you very much! That was it, what I searched!
Now it works all fine.
As system I installed the Live Distributation Knoppix, cause each other distributation couldn't been installed - Why? I don't know. The file /etc/debian_version says "6.0.5".
Thank you for the tipp with the /etc/skel!
Quote:
Originally Posted by /etc/bash.bashrc
# System-wide .bashrc file for interactive bash(1) shells.
# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.
# General
[ -r /etc/profile ] && . /etc/profile
# bash-specific
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt
PS1='${debian_chroot:+($debian_chroot)}\[\e[0;32m\]\u@\h:\w\$\[\e[00m\] '
# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac
# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
else
return 127
fi
}
fi
# KNOPPIX: Activate Control groups for this shell's processes
if [ -d /cgroup/cpu/user ]; then
mkdir -m 0700 /cgroup/cpu/user/$$
echo $$ > /cgroup/cpu/user/$$/tasks
echo -n 1 > /cgroup/cpu/user/$$/notify_on_release
fi >/dev/null 2>&1
Knoppix is meant to be used as a Live CD/DVD and they explain at knoppix.net site below why you will likely have problems using it from a hard drive unless you are a "hard-core experience Linux user":
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.