Page 1 of 1
Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:30
by mf-scripts
Ich hatte gerade das Vergnüngen an einem Suse Server etwas zu ändern. Dabei ist mir aufgefallen, dass die "dir" funktion dort viel schöner ist. Man sieht, ob es eine Datei oder ein Verzeichnis ist (farbig dargestellt) und wann die datei geändert wurde, sowie die Rechte.
Wenn ich "dir" auf meinem Debian Server aufrufe stehen die Dateien/Ordner da alle in einer Reihe hinter einander und man sieht nicht, ob es ein Ordner oder Datei ist. Gibt es eine Möglichkeit das dort genauso zu machen?
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:32
by juergen
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:36
by mf-scripts
Thx, aber kann man das auch automatisieren, sodass ich das nicht immer eingeben?
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:49
by juergen
alias ls='ls --color=auto'
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:51
by mf-scripts
thx :)
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:52
by djcrackman
Und den Alias in /etc/profile eintragen ;).
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 21:55
by mf-scripts
djcrackman wrote:Und den Alias in /etc/profile eintragen ;).
Was soll das bringen?
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 22:13
by daemotron
MF-Scripts wrote:Was soll das bringen?
Log Dich mal wieder aus und noch mal ein... dann weißt Du, warum Du das besser in /etc/profiles einträgst (je nach Distribution kommen auch noch andere Dateien in Fragen, z. B. /etc/bash/bashrc oder ~/.bashrc)
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-12 22:25
by mf-scripts
No Manual Entry for alias
Ist das normal das in /etc/profiles nichts drin steht?
Wie muss ich das da rein schreiben?
alias ls='ls --color=auto'
wenn ich das eintrage, klappt das nicht
EDIT: Nach dem Eintragen in ~/.bashrc hat es geklappt :)
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-13 08:18
by daemotron
MF-Scripts wrote:alias ls='ls --color=auto'
wenn ich das eintrage, klappt das nicht
Sollte aber eigentlich. Hast Du danach ein
ausgeführt?
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-13 14:38
by mf-scripts
jfreund wrote:MF-Scripts wrote:alias ls='ls --color=auto'
wenn ich das eintrage, klappt das nicht
Sollte aber eigentlich. Hast Du danach ein
ausgeführt?
Nö, aber hast du mein Edit nciht gelesen? ;)
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-13 15:53
by lucki2
Ach, bitte(von Vanilla Debian Sarge):
/etc/skel/.bashrc:
Code: Select all
# 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
bzw /root/.bashrc
Code: Select all
# export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
Wenn Du andere Farben haben willst mußt Du eben Deine Farbdefinition als Parameter mit geben
Code: Select all
dircolors -p > meineSchoenenFarben
dann ändere Das obige einfach:
Code: Select all
eval "`dircolors meineSchoenenFarben`"
Re: Debian dir so wie bei Suse machen
Posted: 2006-11-13 16:04
by Joe User
Wo wir schon dabei sind:
Code: Select all
gentoo ~ # cat /etc/bash/bashrc
# /etc/bash/bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control. #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize
# Enable history appending instead of overwriting. #139609
shopt -s histappend
# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions. Use internal bash
# globbing instead of external grep binary.
use_color=false
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
if [[ -f /etc/DIR_COLORS ]] ; then
match_lhs=$(</etc/DIR_COLORS)
elif type -p dircolors >/dev/null ; then
match_lhs=$(dircolors --print-database)
else
match_lhs=""
fi
[[ $'n'${match_lhs} == *$'n'"TERM "${safe_term}* ]] && use_color=true
if ${use_color} ; then
if [[ ${EUID} == 0 ]] ; then
PS1='[\033[01;31m]h[\033[01;34m] W $[\033[00m] '
else
PS1='[\033[01;32m]u@h[\033[01;34m] w $[\033[00m] '
fi
alias ls='ls --color=auto'
alias grep='grep --colour=auto'
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1='u@h W $ '
else
PS1='u@h w $ '
fi
fi
# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs
gentoo ~ # cat /etc/skel/.bashrc
# /etc/skel/.bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
if [[ -f ~/.dir_colors ]] ; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
alias ls='ls --color=auto'
alias grep='grep --colour=auto'
# Change the window title of X terminals
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
;;
screen)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\"'
;;
esac
gentoo ~ # cat /etc/skel/.bash_profile
# /etc/skel/.bash_profile
# This file is sourced by bash for login shells. The following line
# runs your .bashrc and is recommended by the bash info pages.
[[ -f ~/.bashrc ]] && . ~/.bashrc
gentoo ~ #