1. Тръгвате да ползвате някаква команда, но се забравили нужната ви опция, то просто натискате "tab" бутон и ви се принтира help за да се подсетите. Примерно командата ls -a и искам да видя, кой параметър е за време на създаване
- Код за потвърждение: Избери целия код
[gaara: ~]$ ls -lt (08-23 19:10)
option
-1 -- single column output
-A -- list all except . and ..
-B -- don't list entries ending with ~
-C -- list entries in columns sorted vertically
-D -- generate output designed for Emacs' dired mode
-F -- append file type indicators
-G -- inhibit display of group information
-H -- sizes in human readable form; powers of 1000
-I -- don't list entire matching pattern
-L -- list referenced file for sym link
-N -- print raw characters
-Q -- quote names
-R -- list subdirectories recursively
-S -- sort by size
-T -- specify tab size
-U -- unsorted
-X -- sort by extension
-a -- list entries starting with .
-b -- print octal escapes for control characters
-c -- status change time
-d -- list directory entries instead of contents
-f -- unsorted, all, short list
-g -- long listing but without owner information
-h -- print sizes in human readable form
-i -- print file inode numbers
-k -- use block size of 1k
-m -- comma separated
-n -- numeric uid, gid
-o -- no group, long
-p -- append file type indicators except *
-q -- hide control chars
-r -- reverse sort order
-s -- display size of each file in blocks
-t -- sort by modification time
-u -- access time
-v -- sort by version (filename treated numerically)
-w -- specify screen width
-x -- sort horizontally
2. Изписал съм някакъв безкраен ред с команди, но не се сещам как се ползваше "sed".... няма проблем.... заставам в/у него с маркера, натискам alt+h и ми се отваря man page-a

- Код за потвърждение: Избери целия код
[gaara: ~]$ cat /etc/resolv.conf |grep -v ^# |sed #заставам в/у sed-> alt+h, прочитам си нужната информация, натискам q за изход от man-a и продължавам да си дописвам командата :)
3. При писането на команди и не ползването на "tab", понякога води до грешки в самите команди, като след това трябва copy->paste и редактиране, но тук нещата стават малко по-различни

- Код за потвърждение: Избери целия код
[gaara: ~]$ car /proc/meminfo | egrep "^M.+t+"
zsh: command not found: car
[gaara: ~]$ ^car^cat
cat /proc/meminfo | egrep "^M.+t+"
MemTotal: 1036236 kB
[gaara: ~]$
т.е. казах му ^car^cat (да замени car с cat)
За инсталация под Дебиан ... простичко изпълнете apt-get install zsh

За да смените подразбиращият се shell, използвайте командата chsh

Ето и .zshrc-то, което аз ползвам:
- Код за потвърждение: Избери целия код
[gaara: ~]$ grep -v "^#" .zshrc (08-23 19:14)
setopt INC_APPEND_HISTORY SHARE_HISTORY
setopt APPEND_HISTORY
unsetopt BG_NICE # do NOT nice bg commands
setopt CORRECT # command CORRECTION
setopt EXTENDED_HISTORY # puts timestamps in the history
setopt MENUCOMPLETE
setopt ALL_EXPORT
setopt notify globdots correct pushdtohome cdablevars autolist
setopt correctall autocd recexact longlistjobs
setopt autoresume histignoredups pushdsilent
setopt autopushd pushdminus extendedglob rcquotes mailwarning
unsetopt bgnice autoparamslash
zmodload -a zsh/stat stat
zmodload -a zsh/zpty zpty
zmodload -a zsh/zprof zprof
zmodload -ap zsh/mapfile mapfile
HISTFILE=$HOME/.zhistory
HISTSIZE=1000
SAVEHIST=1000
HOSTNAME="`hostname`"
PAGER='less'
EDITOR='vim'
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOR="%{$terminfo[sgr0]%}"
PS1="[$PR_GREEN%n: $PR_BLUE%1~$PR_NO_COLOR]%(!.#.$) "
RPS1="$PR_LIGHT_YELLOW(%D{%m-%d %H:%M})$PR_NO_COLOR"
LC_ALL='en_US.UTF-8'
LANG='en_US.UTF-8'
LC_CTYPE=C
if [ $SSH_TTY ]; then
MUTT_EDITOR=vim
else
MUTT_EDITOR=emacsclient.emacs-snapshot
fi
unsetopt ALL_EXPORT
alias f=finger
alias ll='ls -al'
alias ls='ls --color=auto '
autoload -U compinit
compinit
bindkey "^?" backward-delete-char
bindkey '^[OH' beginning-of-line
bindkey '^[OF' end-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[6~' down-line-or-history
bindkey "^r" history-incremental-search-backward
bindkey ' ' magic-space # also do history expansion on space
bindkey '^I' complete-word # complete on tab, leave expansion to _expand
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' menu select=1 _complete _ignored _approximate
zstyle -e ':completion:*:approximate:*' max-errors \
'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*::::' completer _expand _complete _ignored _approximate
zstyle -e ':completion:*:approximate:*' max-errors \
'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
zstyle ':completion:*:expand:*' tag-order all-expansions
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 ''
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
zstyle ':completion:*:processes' command 'ps -au$USER'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*' hosts $(awk '/^[^#]/ {print $2 $3" "$4" "$5}' /etc/hosts | grep -v ip6- && grep "^#%" /etc/hosts | awk -F% '{print $2}')
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \
'*?.old' '*?.pro'
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*:*:*:users' ignored-patterns \
adm apache bin daemon games gdm halt ident junkbust lp mail mailnull \
named news nfsnobody nobody nscd ntp operator pcap postgres radvd \
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs avahi-autoipd\
avahi backup messagebus beagleindex debian-tor dhcp dnsmasq fetchmail\
firebird gnats haldaemon hplip irc klog list man cupsys postfix\
proxy syslog www-data mldonkey sys snort
zstyle ':completion:*:scp:*' tag-order \
files users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'
zstyle ':completion:*:scp:*' group-order \
files all-files users hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order \
users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'
zstyle ':completion:*:ssh:*' group-order \
hosts-domain hosts-host users hosts-ipaddr
zstyle '*' single-ignored show
[gaara: ~]$
Ето и пример от крайният резултат:
- Код за потвърждение: Избери целия код
# натиснал съм "tab"
# от дясно е датата и часа
[gaara: ~]$ cd /sbin/ (08-23 19:20)
directory
sbin/ srv/ sys/