The Z-Shell is IMHO a way better shell to use than the BASH for your daily work. It is very user-friendly, feature-rich and powerful. Especially the tab-completion handling of the ZSH is superior and one of the best I've ever seen. A good and well configured shell is the first thing you need to make your Console and commandline more useful.
Of course this shell needs some configuring and finetuning like everything else. That's why I have prepared my own configuration files for you.
For more information about the Z-Shell you should visit its website. Another great resource is the book ZSH - Die magische Shell (German). Unfortunately it seems to be hard to get. There are some very expensive offerings at Amazon. And no, you can't get mine
The files are listed in alphabetical order.
Depending on its location the corresponding file is a system-wide configuration file or for you personally.
You'll find this file in either /etc/zsh
or as ~/.zlogin
.
Everything within this file is executed at login. Mine looks like this; maybe parts of it will be useful to you (“linuxlogo” and “fortune” must be installed):
linuxlogo -u -y echo /usr/games/fortune -s echo -e "\nIP Information\n--------------" /bin/ip address show|awk '/inet/ {print $2}'|grep -vE '(127.0.0.1|::1/128)' echo -e "\nDisk Free Information\n---------------------" df -h -x tmpfs echo
You'll find this file in either /etc/zsh
or as ~/.zlogout
.
Similar to the zlogin
file everything in here is executed on logout. Mine is quite simple:
clear
You'll find this file in either /etc/zsh
or as ~/.zprofile
.
This file is similar to /etc/profile
. Mine just contains the Debian defaults which I will leave out here.
You'll find this file in either /etc/zsh
or as ~/.zshenv
.
Used for environment variables. Mine just contains the Debian defaults which I will leave out here.
You'll find this file in either /etc/zsh
or as ~/.zshrc
.
zshrc.gz
Size: 2,0 kB
This is the main configuration file of the Z-Shell and contains the major part of the configuration. The file is too long to quote here, please feel free to download it. Also, it contains quite a lot of control sequences for the colours which would get lost during copy/paste.
The file contains two sections, the upper is suitable for a system-wide configuration as it sets some options (umask and prompt color) depending on whether you are root or not. Of course you can choose to ignore that and use that configuration for yourself only (i.e. only settings for non-root will be activated).
The lower part is suitable for either your personal configuration or as a system-wide configuration, depending on your wishes. Personally I'd advise to put as much in your personal configuration as possible. Just unpack the file and have a look at the comments for more information.
This file will give you these options (amongst others):
$PATH
environment variable which adds the “sbin-paths” to $PATH
when using sudo.<Tab>
you only want to see “.gz”-files.
The history
command of the ZSH works different than the BASH history. By default, only the last 15 history entries are shown. You could just grep
or less
your ~/.zsh_history
file for getting the information you want, but there are more convenient ways.
history | Show the last 15 entries of your history. |
history 0 | Show all history entries. |
history -i | Show the last 15 history entries including human readable timestamps. |
history -i 0 | Show all history entries including human readable timestamps. |
All history entries are always numbered. Note that human readable timestamps only work with the extended history enabled.