ls farbige Ausgabe geht nich

Warum Debian und/oder eine seiner Spielarten? Was muss ich vorher wissen? Wo geht es nach der Installation weiter?
Antworten
Benutzeravatar
Corcovado
Beiträge: 222
Registriert: 13.02.2005 13:01:55

ls farbige Ausgabe geht nich

Beitrag von Corcovado » 04.04.2005 17:28:03

Hi,
Ich hab ein sarge/2.6.8 mit Fluxbox. In meiner .bashrc hab ich bei user und root diese alisa Anweisungen zur farbigen Ausgabe bei ls entkommentiert. Bei der gnome shell funktioniert das auch, aber bei eterm (den ich auch drauf hab) genauso wie bei den tty's bleibt alles weiss.
wenn ich allerdings ls mit der Option die ausgabe bunt zu machen bspw auf der tty eingebe erhalte ich schon Farben, wie bekomm ich das dauerhaft hin?! Warum wird meine .bashrc nicht respektiert von meinem Rechner?

Hier is die bashrc von zB user:

Code: Alles auswählen

#
 ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples



# If running interactively, then:
if [ "$PS1" ]; then

    # 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

    # enable color support of ls and also add handy aliases
    if [ "$TERM" != "dumb" ]; then
        eval `dircolors -b`
        alias ls='ls --color=auto'
        alias dir='ls --color=auto --format=vertical'
        alias vdir='ls --color=auto --format=long'
    fi

    # some more ls aliases
    alias ll='ls -l'
    alias la='ls -A'
    alias l='ls -CF'

    # set a fancy prompt
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

    # If this is an xterm set the title to user@host:dir
    case $TERM in
    xterm*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    *)
        ;;
    esac

    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc).
    #if [ -f /etc/bash_completion ]; then
    #  . /etc/bash_completion
    #fi
fi

Benutzeravatar
tcs
Beiträge: 153
Registriert: 20.10.2003 14:18:16

Beitrag von tcs » 04.04.2005 17:43:27

Hi,

ich hab bei mir dieses Zeug einfach aus gentoo übernommen...

.bashrc:

Code: Alles auswählen

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# 077 would be more secure, but 022 is generally quite realistic
umask 022

if [ `/usr/bin/whoami` = 'root' ]
then
    # Do not set PS1 for dumb terminals
    if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
    then
        export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
    fi
    export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
else
    # Do not set PS1 for dumb terminals
    if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
    then
        export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
    fi
    export PATH=".:/bin:/usr/bin:${PATH}"
fi
unset ROOTPATH
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]
then
    export INPUTRC="/etc/inputrc"
fi

# Extract the value of EDITOR
[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="`. /etc/conf.d/basic 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="/bin/nano"
export EDITOR

alias nano="nano -w"
alias ls="ls --color -F"
alias la="ls -la --color -F"
.bash_profile:

Code: Alles auswählen

# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/login.defs
#umask 022

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# the rest of this file is commented out.

# set PATH so it includes user's private bin if it exists
#if [ -d ~/bin ] ; then
#    PATH=~/bin:"${PATH}"
#fi
/etc/profile:

Code: Alles auswählen

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

#if [ "$PS1" ]; then
#  if [ "$BASH" ]; then
#    PS1='\u@\h:\w\$ '
#  else
#    if [ "`id -u`" -eq 0 ]; then
#      PS1='# '
#    else
#      PS1='$ '
#    fi
#  fi
#fi

if [ `/usr/bin/whoami` = 'root' ]
then
    # Do not set PS1 for dumb terminals
    if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
    then
        export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
    fi
    export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:${ROOTPATH}"
else
    # Do not set PS1 for dumb terminals
    if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
    then
        export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
    fi
    export PATH="/bin:/usr/bin:/usr/local/bin:${PATH}"
fi

unset ROOTPATH
export PATH

umask 022
Damit funktioniert's bei mir...

Cheers

tcs

Benutzeravatar
Corcovado
Beiträge: 222
Registriert: 13.02.2005 13:01:55

Beitrag von Corcovado » 04.04.2005 18:00:51

Danke!!!

Haste des dann bei root UND user reingehaun oder nur bei user (das hab ich grad - etwas giftige farbeinstellungen, wie ich finde - AFFENGEIL !!!)

Benutzeravatar
tcs
Beiträge: 153
Registriert: 20.10.2003 14:18:16

Beitrag von tcs » 04.04.2005 18:18:11

Gern geschehen!

Die files für root:

.bashrc:

Code: Alles auswählen

# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval `dircolors`
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias la='ls $LS_OPTIONS -la'
#
# Some more alias to avoid making mistakes:
 alias rm='rm -i'
 alias cp='cp -i'
 alias mv='mv -i'

source /etc/profile
.profile:

Code: Alles auswählen

# ~/.profile: executed by Bourne-compatible login shells.

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

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
export PATH

mesg n
Normale User haben giftig grünen prompt, ro(o)t hat eine entsprechend andere Farbgebung :wink:

Cheers

tcs

Benutzeravatar
Corcovado
Beiträge: 222
Registriert: 13.02.2005 13:01:55

Beitrag von Corcovado » 05.04.2005 23:51:00

AWESOME !!!
...ich bekomm gleich nen Farbflash - alles so bunt auf einmal - Danke !!! 8O

Antworten