BSDForen.de  

Zurück   BSDForen.de > FreeBSD > FreeBSD - Allgemein

Antwort
 
Themen-Optionen Thema bewerten Ansicht
Alt 02.09.2006, 18:00   #1
jbo75
Registered User
 
Registrierungsdatum: Aug 2006
Ort: Leipzig
Beiträge: 34
Question bash ls

Kann man in der bash den Befehl ls -lhG permanent für ls definieren?
Ich hab schon im Wiki nachgeschaut und alias ls="ls -hlG" probiert.
Das klappt zwar, aber halt nur temporär.
jbo75 ist offline   Mit Zitat antworten
Alt 02.09.2006, 18:04   #2
pertze
DuBHeaD
 
Benutzerbild von pertze
 
Registrierungsdatum: Jun 2003
Beiträge: 485
Code:
echo 'alias ls="ls -Ghl"' >> ~/.bash_profile . ~/.bash_profile
-Update-
.bashrc ersetzt durch .bash_profile, da die bash ja wahrscheinlich deine login shell ist

Geändert von pertze (02.09.2006 um 18:17 Uhr).
pertze ist offline   Mit Zitat antworten
Alt 02.09.2006, 18:28   #3
jbo75
Registered User
 
Registrierungsdatum: Aug 2006
Ort: Leipzig
Beiträge: 34
Die ~/.bash_profile wurde korrekt erstellt und es klappt auch, jedoch wieder nur temporär. sobald ich eine neue console öffne ist alles wieder beim alten. Oder muss ich z.B aterm immer mit aterm -e . ~/.bash_profile starten?



edit:

also das aterm -e . ~/.bash_profile hab ich probiert und es klappt nicht.
aber mit der .bashrc klappt es genau so wie ich es will.
Danke

Geändert von jbo75 (02.09.2006 um 18:40 Uhr).
jbo75 ist offline   Mit Zitat antworten
Alt 02.09.2006, 20:14   #4
Maxx
Registered User
 
Benutzerbild von Maxx
 
Registrierungsdatum: Jul 2006
Beiträge: 96
Zitat:
Zitat von jbo75
Die ~/.bash_profile wurde korrekt erstellt und es klappt auch, jedoch wieder nur temporär. sobald ich eine neue console öffne ist alles wieder beim alten. Oder muss ich z.B aterm immer mit aterm -e . ~/.bash_profile starten?



edit:

also das aterm -e . ~/.bash_profile hab ich probiert und es klappt nicht.
aber mit der .bashrc klappt es genau so wie ich es will.
Danke
~/.bash_profile wird nur beim Login ausgefuehrt. Du musst dich also neu anmelden um diese Datei neu zu uebernehmen.

Noch ein Tipp: Nimm Zsh
Maxx ist offline   Mit Zitat antworten
Alt 02.09.2006, 20:24   #5
jbo75
Registered User
 
Registrierungsdatum: Aug 2006
Ort: Leipzig
Beiträge: 34
Was hat denn Zsh für Vorteile?
Ich muss dazu sagen das ich noch recht neu in der Unix Umgebung bin.
Bash habe ich eigentlich nur wegen dem autocomplete mit Tab genommen, das war unter sh immer ein Krampf :
jbo75 ist offline   Mit Zitat antworten
Alt 02.09.2006, 20:48   #6
kili
just me
 
Benutzerbild von kili
 
Registrierungsdatum: Nov 2004
Ort: Braunschweig
Beiträge: 783
Zitat:
Zitat von jbo75
Bash habe ich eigentlich nur wegen dem autocomplete mit Tab genommen, das war unter sh immer ein Krampf :
ksh(1) hat auch Completion kleiner ist kleiner und effizienter als bash(1).
kili ist offline   Mit Zitat antworten
Alt 02.09.2006, 20:53   #7
ninscho
Registered User
 
Registrierungsdatum: Mar 2005
Ort: Linz
Beiträge: 17
Zitat:
Zitat von jbo75
Was hat denn Zsh für Vorteile?
da kann ich nur http://www.michael-prokop.at/compute...liebhaber.html empfehlen; mag zwar etwas subjektiv sein, aber was solls ;-)
ninscho ist offline   Mit Zitat antworten
Alt 02.09.2006, 23:47   #8
danlei
Registered User
 
Benutzerbild von danlei
 
Registrierungsdatum: Jan 2006
Beiträge: 431
Probieren geht über Studieren; deshalb hier mal meine .zshrc. Installier Dir die zsh, .zshrc nach ~ und probier mal ein Bisschen, z.B. Tab in fast jeder Lebenslage, **, Verzeichnis ohne cd wechseln, +/- um durch dirs zu navigieren, gutes VI-Lineediting ...

Code:
################# # .zshrc danlei # ################# cdpath=(. .. ~ ~/src ~/zsh) # Use hard limits, except for a smaller stack and no core dumps unlimit limit stack 8192 limit core 0 limit -s umask 022 # Set up aliases alias mv='nocorrect mv' # no spelling correction on mv alias cp='nocorrect cp' # no spelling correction on cp alias mkdir='nocorrect mkdir' # no spelling correction on mkdir alias md='nocorrect mkdir' alias locate='nocorrect locate' alias emacs='emacs -nw' alias ls='ls -G' alias l='ls' alias rd='rmdir' alias ll='ls -lh' alias la='ls -alh' alias ld='ls -dh' # List only directories and symbolic # links that point to directories alias lsd='ls -ld *(-/DN)' # List only file beginning with "." alias l.='ls -ldh .*' alias dirs='dirs -v' alias df='df -h' alias du='du -h' alias c='clear' # cd by .. or ... or mv file ..../. alias -g ...='../..' alias -g ....='../../..' alias -g .....='../../../..' # allow + and - for switching between dirs alias -- +='pushd +0' alias -- -='pushd -1' alias -- ++='pushd +1' alias -- --='pushd -2' alias -- +++='pushd +2' alias -- ---='pushd -3' # set up run-help #unalias run-help #autoload run-help # Shell functions setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } # csh compatibility freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done } # Where to look for autoloaded function definitions fpath=($fpath ~/.zfunc) # Autoload all shell functions from all directories in $fpath (following # symlinks) that have the executable bit on (the executable bit is not # necessary, but gives you an easy way to stop the autoloading of a # particular shell function). $fpath should not be empty for this to work. for func in $^fpath/*(N-.x:t); autoload $func # automatically remove duplicates from these arrays typeset -U path cdpath fpath manpath # Hosts to use for completion (see later zstyle) hosts=(`hostname` ftp.math.gatech.edu prep.ai.mit.edu \ wuarchive.wustl.edu www.bsdforen.de www.google.de) # Set prompts autoload colors colors # Nice colored prompt, which displays red exid code, if not 0 PROMPT="%{${fg[red]}%}%(?..(%?%))%{${fg[cyan]}%}[%n@%m %~]%# %{${fg[white]}%}" # Some environment variables export MAIL=/var/spool/mail/$USERNAME #export HELPDIR=/usr/lib/zsh/help # directory for run-help function to find docs MAILCHECK=300 HISTSIZE=1000 DIRSTACKSIZE=35 SAVEHIST=1000 HISTFILE="$HOME/.zhistory" # Watch for my friends #watch=( $(<~/.friends) ) # watch for people in .friends file watch=(notme) # watch for everybody but me LOGCHECK=300 # check every 5 min for login/logout activity WATCHFMT='%n %a %l from %m at %t.' # Set/unset shell options setopt notify correct pushdtohome cdablevars autolist setopt correctall autocd recexact longlistjobs histignorespace setopt autoresume histignoredups pushdsilent pushdignoredups noclobber setopt histnostore histnofunctions nohistbeep nobeep autocd multios sharehistory setopt autopushd pushdminus extendedglob rcquotes mailwarning histreduceblanks #setopt globdots noflowcontrol unsetopt bgnice autoparamslash # Autoload zsh modules when they are referenced zmodload -a zsh/stat stat zmodload -a zsh/zpty zpty zmodload -a zsh/zprof zprof zmodload -a -p zsh/mapfile mapfile # Setup new style completion system. To see examples of the old style #(compctl based) programmable completion, check Misc/compctl-examples in the zsh # distribution. autoload -U compinit compinit # Completion Styles # list of completers to use zstyle ':completion:*::::' completer _expand _complete _ignored _approximate # allow one error for every three characters typed in approximate completer zstyle -e ':completion:*:approximate:*' max-errors \ 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' # insert all expansions for expand completer zstyle ':completion:*:expand:*' tag-order all-expansions # formatting and messages zstyle ':completion:*' verbose yes zstyle ':completion:*:descriptions' format '%B%d%b' zstyle ':completion:*:messages' format '%d' zstyle ':completion:*:warnings' format 'No matches for: %d' zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' zstyle ':completion:*' group-name '' # match uppercase from lowercase zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # offer indexes before parameters in subscripts zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters # command for process lists, the local web server details and host completion #zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args' #zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html' zstyle '*' hosts $hosts # Filename suffixes to ignore during completion (except after rm, see alias also) zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \ '*?.old' '*?.pro' # ignore completion functions (until the _ignored completer) zstyle ':completion:*:functions' ignored-patterns '_*' # Newsserver export NNTPSERVER=news.t-online.de #export NNTPSERVER=freenews.netfront.net #export NNTPSERVER=post.newsfeeds.com # Keybindings bindkey -v # VI bindkey '^r' history-incremental-search-backward bindkey '^x' push-line bindkey '^p' copy-prev-word bindkey '^d' describe-key-briefly bindkey '^j' accept-line-and-down-history
Der Prompt ist sicherlich nicht jedes Puristen Sache, aber ich habe bei nem Farbigen einfach den besseren Überblick, besonders bei 1024x768. Da stört auch der komplette Pfad meist nicht -- ist ja genug Platz (Wenn nicht hilft \n).

EDIT: Da hat ein Stück gefehlt, jetzt ists komplett...
__________________
»I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.«
»[Lisp is] the greatest single programming language ever designed.«

Geändert von danlei (03.09.2006 um 08:18 Uhr).
danlei ist offline   Mit Zitat antworten
Alt 03.09.2006, 10:08   #9
Maxx
Registered User
 
Benutzerbild von Maxx
 
Registrierungsdatum: Jul 2006
Beiträge: 96
Die Zsh hat out-of-the-box Completion fuer massenhaft Kram, auch fuer sysctl, BSDs pkg_* usw. usf.
Maxx ist offline   Mit Zitat antworten
Alt 03.09.2006, 14:56   #10
jbo75
Registered User
 
Registrierungsdatum: Aug 2006
Ort: Leipzig
Beiträge: 34
Ich hab jetzt mal etwas mit der Zsh rumgespielt und finde sie wirklich gut.
Aber jetzt kommt schon wieder die nächste Frage
Die Funktion "sched" ist ne feine Sache, nur leider ist die Ausgabe gebuffert, d.h. es wird erst nach einer neuen Eingabe ausgegeben. Ich wollte so eigentlich einen Wecker realisieren, nur gebuffert bringt das leider nix. Gibt es eine Möglichkeit "sched" auch ungebuffert auszuführen? Ein man zu "sched" hab ich nicht gefunden und google brachte leider auch nix :/
Oder gibts evtl. eine andere Funktion welche man NICHT als root ausführen muss ("at" hab ich mir auch schon angeschaut)?
Ich weiß, man kann auch einfach nen cronjob machen, aber da sich meine Weckzeiten ständig ändern wäre eine Funktion wie "sched" wirklich die beste Lösung.
jbo75 ist offline   Mit Zitat antworten
Antwort


Dieses Thema betrachten zurzeit 1 Personen. (0 registrierte Benutzer und 1 Gäste)
 
Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist An.
Smileys sind An
[IMG] Code ist An
HTML-Code ist Aus
Gehe zu

Ähnliche Themen
Thema Erstellt von Forum Antworten Letzter Beitrag
Probleme mit Linuxanwendungen cryptosteve FreeBSD - Anwendungen und Ports 35 27.07.2006 15:16
Fehlermeldung in Bash mad-mongo MacOS X & Darwin 4 06.07.2005 22:07
Symlink auf ls -G lemming FreeBSD - Allgemein 2 24.03.2005 12:50
TCSH-Feature in der BASH? berg FreeBSD - Anwendungen und Ports 8 01.08.2004 14:15
Bash zur default shell machen Sonic_Traveler FreeBSD - Anwendungen und Ports 9 24.09.2003 20:00


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:01 Uhr.


Powered by vBulletin (Deutsch)
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.