Install zsh on Linux and zsh on Linux

Source: Internet
Author: User
Tags autoload gz file

Install zsh on Linux and zsh on Linux

Introduction:

Zsh is an excellent alternative to the default shell-bash in most linux distributions. zsh is a structured shell and also a powerful programming language. Many excellent bash, ksh, and tcsh are implemented in zsh. at the same time, zsh has many excellent native features.

Birth:

Paul Falstad released the first version of zsh in 1990, when he was a principal at Princeton University.

Name Source:

The name is from Professor Zhong Shao at Yale University, where he was a TA at Princeton University. paul Falstad thinks that the Shao login name "zsh" is a suitable shell Name. so zsh was born.

Installation:

This article is based on ubuntu10.10 release.

sudo apt-get install zsh

First Run

You will get the following output during the first running.

This is the Z Shell configuration function for new users,zsh-newuser-install.  You are seeing this message because you have no zsh startup files(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory~). This function can help you with a few settings that shouldmake your use of the shell easier.  You can:  (q) Quit and do nothing. The function will be run again next time.  (0) Exit, creating the file ~/.zshrc containing just a comment.That will prevent this function being run again.  (1) Continue to the main menu.  (2) Populate your ~/.zshrc with the configuration recommended by the system administrator and exit (you will need to edit the file by hand, if so desired).  

Because this is the first time running, the configuration interface will appear. We will temporarily select 0 here to achieve subsequent customization.

Features

Tab completion

Zsh implements a fully programmable completion method, allowing the user to allow the shell to automatically complete parameters of various commands (even those commands unrelated to the shell itself ), automatically fill in many shell conversion definitions and many appropriate parameter types. for example, if you enter tar xvf, the system automatically selects the tar.gz file and skips the non-conforming files. now zsh has more than 500 completion definitions by default.

Implementation Method:

%autoload -U compinit  %compinit  

More advanced completion:

% zstyle ':completion:*:descriptions' format '%U%B%d%b%u' % zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b' 

It can automatically complete commands, parameters, file names, processes, user names, variables, permission characters, and so on.

Select prompt

Zsh has many default prompt themes. First, you need to initialize advanced prompt support.

%autoload -U promptinit  %promptinit  

View available prompt topics: prompt-p

Here I select promot elite2 red

Custom history information:

Here we set the history file bit of the record command ~ /. Histfile: Record 1000 commands in the current shell. After the shell is closed, save the last 1000 commands used.

HISTFILE=~/.histfile  HISTSIZE=1000  SAVEHIST=1000  

If you do not want to save the duplicate history

setopt hist_ignore_all_dups hist_ignore_space  

Automated CD commands

Zsh allows you to just enter the path of the folder you want to enter, instead of entering cd. For example, you want to enter/etc/init. d

First open the autocd option setopt autocd

Enter/etc/init. d and press enter to enter the folder.

Replace wildcard characters with extended file names

File Name replacement allows you to expand the file wildcard to produce some specific files. The majority of shells are always using file name replacement. For example:

%ls foo*  foo1 foo2 

Powerful redirection functions:

Redirects stdout and stderr to file: command | &> file to multiple files at the same time: command> file.1> file.2

Zsh is indeed a powerful shell that supports many interesting wildcard extensions. you can use wildcard numbers, which are special characters. for example, to list all symbolic link files in the current folder:

%ls *(@) 

The wildcard character "/" of zsh indicates the directory, and "." indicates the common file. view more man zshexpn. If no match exists, zsh returns an error.

There are other types, such as "/", indicating that zsh matches the current directory and all subdirectories of the current directory. for example, find any ". sh "or ". py "file,

%ls -l **/*.(sh|py)  

Make the configuration take effect

To replace the extended file name, add the following command ~ /. Zshrc

autoload -Uz compinitcompinitzstyle :compinstall filename '/home/capecchi/.zshrc'zstyle ':completion:*:descriptions' format '%U%B%d%b%u'zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
Prompt setup
autoload -U promptinitpromptinitprompt elite2 yellow
History
HISTFILE=~/.histfileHISTSIZE=1000SAVEHIST=1000
We set some options here
setopt appendhistory autocd hist_ignore_all_dups hist_ignore

Note :~ The/. zshrc file can be used for interaction and shell logon. If you want to set options for zsh (that is, using cronjob) that is not run interactively, you need to add the commands in ~ /. After zshenv

Change the default logon shell:

Normal users can change their own chsh-s/bin/zsh username, while root users can change

Reference: http://www.linuxaria.com/howto/introduzione-a-zsh? Lang = it

Http://www.builder.com.cn/2007/0328/383678.shtml

Http://linuxtoy.org/archives/zsh.html


Linux zsh shell split windows

Software:
Windows
Splitvt, easy to operate, but the effect is too simple, just a single cross-cutting
In my blog's photo album linux section

How to install software on LINUX

You have installed Windows programs. Yulin Mufeng modified the ubuntu version and is also based on debian. The installation in linux is different from that in windows, you can use xindeli or enter sudo apt-get install "Name of the software to be installed" on the terminal. Some software must be added to the source, the source code packages on the Internet should be compiled by yourself. Generally, make and make install ...... There is also a deb package that can be installed by double-clicking but few. Of course, Windows can use the software. linux cannot be installed. Generally, you should use wine simulation. If wine has poor performance, we suggest you find a native alternative, you can use mutiget for downloading. If you are not used to it, the domestic software has launched the linux version by express. You can download it. the deb package can be installed. If wine is used, Thunder has an international version. You can find that this is the only one that can be installed. QQ has also launched the linux version, but it is quite poor and can be replaced by the web version. The landlord should be a new user. It is recommended that you abandon the habit of win and study again. There is a bird's tutorial on the internet, 'linux Baidu, to find a good way. Everyone will never understand it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.