linux 默认bash shell是这样
想变的酷一点,类似这样:
先了解下什么是zsh?
https://wiki.archlinux.org/index.php/Zsh_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
官网:https://ohmyz.sh/ 提供两种安装方式
//via curl
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
//via wget
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
报错zsh 没有安装
[root@VM_0_8_centos /]# sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Zsh is not installed! Please install zsh first!
[root@VM_0_8_centos /]# sudo yum install -y zsh
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Determining fastest mirrors
epel | 3.2 kB 00:00:00
extras | 3.4 kB 00:00:00
os | 3.6 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/6): os/7/x86_64/group_gz | 166 kB 00:00:00
(2/6): extras/7/x86_64/primary_db | 156 kB 00:00:00
(3/6): epel/7/x86_64/updateinfo | 940 kB 00:00:00
(4/6): updates/7/x86_64/primary_db | 1.3 MB 00:00:00
(5/6): epel/7/x86_64/primary | 3.6 MB 00:00:00
(6/6): os/7/x86_64/primary_db | 6.0 MB 00:00:00
epel 12745/12745
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:5.0.2-31.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================================
Installing:
zsh x86_64 5.0.2-31.el7 os 2.4 M
Transaction Summary
=================================================================================================================================================================================================================================================
Install 1 Package
Total download size: 2.4 M
Installed size: 5.6 M
Downloading packages:
zsh-5.0.2-31.el7.x86_64.rpm | 2.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : zsh-5.0.2-31.el7.x86_64 1/1
Verifying : zsh-5.0.2-31.el7.x86_64 1/1
Installed:
zsh.x86_64 0:5.0.2-31.el7
Complete!
[root@VM_0_8_centos /]# zsh --version
zsh 5.0.2 (x86_64-redhat-linux-gnu)
执行zsh --version
检测,zsh安装成功
继续执行安装oh my Zsh
又报错,git没安装
[root@VM_0_8_centos]/# sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Error: git is not installed
[root@VM_0_8_centos]/# yum install -y git
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-20.el7.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================================================
Installing:
git x86_64 1.8.3.1-20.el7 updates 4.4 M
Installing for dependencies:
perl-Error noarch 1:0.17020-2.el7 os 32 k
perl-Git noarch 1.8.3.1-20.el7 updates 55 k
perl-TermReadKey x86_64 2.30-20.el7 os 31 k
Transaction Summary
=================================================================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 4.5 M
Installed size: 22 M
Downloading packages:
(1/4): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:00
(2/4): perl-Git-1.8.3.1-20.el7.noarch.rpm | 55 kB 00:00:00
(3/4): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:00
(4/4): git-1.8.3.1-20.el7.x86_64.rpm | 4.4 MB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.4 MB/s | 4.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:perl-Error-0.17020-2.el7.noarch 1/4
Installing : perl-TermReadKey-2.30-20.el7.x86_64 2/4
Installing : git-1.8.3.1-20.el7.x86_64 3/4
Installing : perl-Git-1.8.3.1-20.el7.noarch 4/4
Verifying : perl-Git-1.8.3.1-20.el7.noarch 1/4
Verifying : 1:perl-Error-0.17020-2.el7.noarch 2/4
Verifying : git-1.8.3.1-20.el7.x86_64 3/4
Verifying : perl-TermReadKey-2.30-20.el7.x86_64 4/4
Installed:
git.x86_64 0:1.8.3.1-20.el7
Dependency Installed:
perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-20.el7 perl-TermReadKey.x86_64 0:2.30-20.el7
Complete!
git安装好后,继续执行安装oh my Zsh
[root@VM_0_8_centos]/# sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Cloning into '/root/.oh-my-zsh'...
remote: Enumerating objects: 991, done.
remote: Counting objects: 100% (991/991), done.
remote: Compressing objects: 100% (909/909), done.
remote: Total 991 (delta 25), reused 840 (delta 18), pack-reused 0
Receiving objects: 100% (991/991), 640.18 KiB | 253.00 KiB/s, done.
Resolving deltas: 100% (25/25), done.
Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc
__ __
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.
➜ / ls
bin boot data dev dump.rdb etc home lib lib64 lost+found media mnt opt proc root run sbin srv swapfile sys tmp usr var
安装成功
查看系统默认shell,$SHELL
是大写
echo $SHELL
查看系统shell列表
cat /etc/shells
更改系统shell为zsh
chsh -s /usr/bin/zsh
oh my Zsh
默认主题是这样子的
修改vi ~/.zshrc
的ZSH_THEME="robbyrussell"
为ZSH_THEME="agnoster"
➜ / vi ~/.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/root/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
"~/.zshrc" 98L, 3397C
退出终端(如xshell),重新登录,就变成这样了
更换shell后,mongo
环境变量用不了,需要重新配置mongo
环境变量
vi ~/.bash_profile
# 加入mongo配置
export MONGODB_HOME=/usr/local/mongodb-4.0.2/bin
export PATH=$MONGODB_HOME:$PATH
使用source ~/.bash_profile
使环境变量生效
官网: https://ohmyz.sh/
https://www.addictivetips.com/ubuntu-linux-tips/switch-from-bash-to-zsh-on-linux/ (英文)
https://www.jianshu.com/p/9a5c4cb0452d
https://www.jianshu.com/p/97f33b7fac80?utm_source=oschina-app
主题 :https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
zsh: https://blog.csdn.net/u010138906/article/details/78778627
git: https://www.cnblogs.com/liaojie970/p/6253404.html
gcc版本老旧,经常会碰到的问题:/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found。不要在网上找各种方法,直接升级gcc吧
redis配置多个端口,redis启动多个实例
linux如何挂载新买的硬盘?
vim编辑nginx conf文件时,设置高亮/显示行号
vi/vim打开文件提示Found a swap file by the name
linux报错:C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=g++)
linux下如何安装nodejs
linux下安装 redis,以及相关使用
linux下通过yum安装mongodb
RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序
Ubuntu 16.04 发布时,一个引人注目的新特性便是 apt 命令的引入。其实早在 2014 年,apt 命令就已经发布了第一个稳定版,只是直到 2016 年的 Ubuntu 16.04 系统发布时才开始引人关注。随着 apt install package 命令的使用频率和普遍性逐步超过 apt-get install package,越来越多的其它 Linux 发行版也开始遵循 Ubuntu 的脚步,开始鼓励用户使用 apt 而不是 apt-get。
centos查看环境变量与设置环境变量在使用过程中很常见,本文整理了一些常用的与环境变量相关的命令,感兴趣的朋友可以参考下希望对你有所帮助
linux cenos下安装oh my zsh,oh my zsh 用于管理zsh配置,使shell界面更美观。 Zsh 是一款功能强大终端(shell)软件,既可以作为一个交互式终端,也可以作为一个脚本解释器。它在兼容 Bash 的同时 (默认不兼容,除非设置成 emulate sh) 还有提供了很多改进。
通过Nginx反向代理,在一个云服务器上绑定多个域名,不同的域名访问不同的目录,端口
如何在Linux(CentOS 7)上安装Nginx,作为反向代理服务器。
命令从指定点开始将 File 参数指定的文件写到标准输出。如果没有指定文件,那么会使用标准输入。Number 变量指定将多少单元写到标准输出。Number 变量的值可以是正的或负的整数。如果值的前面有 +(加号),从文件开头指定的单元数开始将文件写到标准输出。如果值的前面有 -(减号),那么从文件末尾指定的单元数开始将文件写到标准输出。如果值前面没有 +(加号)或 -(减号),那么从文件末尾指定的单元号开始读取文件