First a beautiful picture
##1 zsh introduction
1.1 Linux shell
Linux/Unix provides many kinds of Shells, why do you need so many Shells? Is it used for frying? Then let me ask you, why do you have so many pieces of the same type of clothes? The color and texture are different. Writing a program is much more complicated than buying clothes, and programmers are often responsible for making complex things simple and simple things complicated. When great programmers see a shell they are unhappy with, they will rewrite it themselves and gradually form some standards. There are several commonly used shells, such as sh, bash, csh, etc. If you want to know how many shells your system has, you can View through the following command:cat /etc/shellsThe display is as follows:
1.2 Introduction to zsh
Zsh is a powerful shell under Linux. Since most Linux products are installed and use bash by default shell
, but this does not affect geeks' enthusiasm for zsh at all. Almost every Linux product contains zsh, which can usually be installed using package managers such as apt-get, urpmi or yum
Zsh has the following main functions
Out-of-the-box, programmable command line completion function can help users enter various parameters and options
Sharing command history among all shells started by the user
With extended file wildcards, this can be achieved without using external commands The find command generally expands file names
Improved variable and array handling
In the buffer Edit multi-line commands in the zone
##Multiple compatibility modes, for example, you can disguise yourself as Bourne shell when running with /bin/sh 可以定制呈现形式的提示符;包括在屏幕右端显示信息,并在键入长命令时自动隐藏
可加载的模块,提供其他各种支持:完整的 TCP 与 Unix 域套接字控制,FTP 客户端与扩充过的数学函数
完全可定制化
1.3 zsh 与 oh-my-zsh 终极配置
之前是因为看到这篇文章:终极 Shell——Zsh 才选择使用 zsh,被它的自动完成、补全功能吸引了。官网:www.zsh.org
选择 oh-my-zsh, oh-my-zsh 是基于 zsh 的功能做了一个扩展,方便的插件管理、主题自定义,以及漂亮的自动完成效果。
在 Github 上找关于 zsh 的项目时发现的,试用了一下觉得很方便,不用像上面文章里面提到的那么复杂,配置一些插件的名称即可使用相应的功能。
牛逼啊!接私活必备的 N 个开源项目!赶快收藏
官网:https://github.com/robbyrussell/oh-my-zsh
2 安装 zsh
2.1 安装 zsh
对于一般的 Ubuntu 系统,配置好正确的源之后,就能直接键入以下命令安装:
sudo apt-get install zsh
2.2 配置 zsh
zsh 的配置是一门大学问,这里不赘述,直接给出一个配置文件,大家可以下载后放入 zsh 配置文档直接使用。(我的一个法国朋友手配的,相当顺手)
把. zshrc 拷贝到相应用户的 home 目录即可(也可以把你的 bash 的配置文件 (~/.bash_prorile 或者~/.profile 等) 给拷贝到 zsh 的配置文件~/.zshrc 里,因为 zsh 兼容 bash)
2.3 取代 bash,设为默认 shell
sudo usermod -s /bin/zsh username
或者
chsh -s /bin/zsh
chsh -s `which zsh`
如果要切换回去 bash:
chsh -s /bin/bash
当然你实在不愿意把 zsh 当成默认的 shell, 而又想使用它, 那么你可以每次进入是都使用zsh
进入, 而输入exit
退出

2.4 安装 oh-my-zsh
直接用 zsh 会很蛋疼,因为 zsh 功能很强大但是太复杂,所以需要 oh-my-zsh 来将它简单化。另外,搜索公众号Linux就该这样学后台回复“Linux”,获取一份惊喜礼包。
直接用 git 从 github 上面下载包
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
备份已有的 zshrc, 替换 zshrc
cp ~/.zshrc ~/.zshrc.origcp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
直接使用脚本安装
cd oh-my-zsh/tools./install.sh
你可以直接直接使用如下命令安装
curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
其本质就是下载并执行了 github 上的 install.sh 脚本, 该脚本位于oh-my-zsh/tools/install.sh
配置主题
oh-my-zsh 集成了大量的主题, 位于 oh-my-zsh/theme
配置主题, 可以通过修改~/.zshrc
中的环境变量ZSH_THEME
来完成
ZSH_THEME="agnoster" # (this is one of the fancy ones)
如果你觉得主题太多你可以选择使用随机模式, 来由系统随机选择
ZSH_THEME="random" # (...please let it be pie... please be some pie..)

详细的主题信息, 可以参见 zsh 主题介绍
配置插件
修改~/.zshrc
中plugins
plugins=(git bundler osx rake ruby)
详细的插件信息, 可以参见 zsh 插件 Plugins 介绍
更新 oh-my-zsh
默认情况下, 您将被提示检查每几周的升级. 如果你想我 ZSH 自动升级本身没有提示你, 修改 `~/.zshrc。另外,搜索公众号顶级算法后台回复“算法”,获取一份惊喜礼包。
disable_update_prompt = true
禁用自动升级, 修改~/.zshrc
disable_auto_update = true
当然你也可以选择手动更新
如果你想在任何时间点升级(也许有人刚刚发布了一个新的插件,你不想等待一个星期?) 你只需要运行:
upgrade_oh_my_zsh
卸载 oh-my-zsh
If you want to uninstall oh-my-zsh
, just execute uninstall_oh_my_zsh zsh
, run from the command line. This will delete itself and restore your previous bash or zsh configuration.
The above is the detailed content of Super beautiful shell for Linux. For more information, please follow other related articles on the PHP Chinese website!

MaintenanceModeinLinuxisaspecialbootenvironmentforcriticalsystemmaintenancetasks.Itallowsadministratorstoperformtaskslikeresettingpasswords,repairingfilesystems,andrecoveringfrombootfailuresinaminimalenvironment.ToenterMaintenanceMode,interrupttheboo

The core components of Linux include kernel, file system, shell, user and kernel space, device drivers, and performance optimization and best practices. 1) The kernel is the core of the system, managing hardware, memory and processes. 2) The file system organizes data and supports multiple types such as ext4, Btrfs and XFS. 3) Shell is the command center for users to interact with the system and supports scripting. 4) Separate user space from kernel space to ensure system stability. 5) The device driver connects the hardware to the operating system. 6) Performance optimization includes tuning system configuration and following best practices.

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

Linux maintenance mode can be entered through the GRUB menu. The specific steps are: 1) Select the kernel in the GRUB menu and press 'e' to edit, 2) Add 'single' or '1' at the end of the 'linux' line, 3) Press Ctrl X to start. Maintenance mode provides a secure environment for tasks such as system repair, password reset and system upgrade.

The steps to enter Linux recovery mode are: 1. Restart the system and press the specific key to enter the GRUB menu; 2. Select the option with (recoverymode); 3. Select the operation in the recovery mode menu, such as fsck or root. Recovery mode allows you to start the system in single-user mode, perform file system checks and repairs, edit configuration files, and other operations to help solve system problems.

The core components of Linux include the kernel, file system, shell and common tools. 1. The kernel manages hardware resources and provides basic services. 2. The file system organizes and stores data. 3. Shell is the interface for users to interact with the system. 4. Common tools help complete daily tasks.

The basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.

The key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software