howto change prompt

  • what is wrong on user@hostname ?


    If you want to change hostname /etc/hostname is yours ...

  • add following files to the (root) home directory if they are'nt exising and add your prefered settings. This change is only valid for the user.
    /etc/profile, /etc/bashrc ... are the global bash configuration files. If a ~/.profile and/or ~/.bashrc will be found, a global setting will be overwritten with the user setting


    ~/.profile (example)

    Code
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi



    ~/.bashrc (example)

    Code
    export PS1='\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;36m\]\w\[\033[1;37m\]# \[\033[0m\]'
    
    
    export LS_OPTIONS='--color=auto'
    
    
    if [ -f ~/.bash_aliases ]; then
            . ~/.bash_aliases
    fi



    ~./bash_aliases (example)

    Code
    alias ls='ls $LS_OPTIONS'
    alias dir='ls -al'
    alias vgrep='grep -v "^#"'




    then reboot or reread the new bash configuration files to make the changes effective

    . ~/.profile && . ~/.bashrc. && . ~/.bash_aliases


    This configuration will not be overwritten by an update!

    Gruß Fred

    Die Dreambox ist tot, es lebe die Dreambox

    3 Mal editiert, zuletzt von Fred Bogus Trumper ()

  • Depending on the source revision of bash, the "right" way to set this globally for all users for an interactive shell would be /etc/bash.bashrc or /etc/bashrc.
    For a login shell it would be /etc/profile.
    Ymmv.

    DM900 SS, DM8000SSSS
    Kein Support per PN! Nutzt das Forum zum Fragen, dann haben auch andere etwas davon.