Mac下终端改造方案

Reading time ~1 minute

1. 概述

好久之前就想折腾一下自己的Terminal了,正好有点时间就把Terminal弄了下,折腾了一下午,终于把Terminal折腾成自己想要的效果了,先上个效果图 Alt text

2. iTerm2 安装

下载iTerm2:http://www.iterm2.com/

安装iTerm2还是很简单的,直接下载安装即可。

查看Mac自带的终端 cat /etc/shells

输出如下:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

说明Mac已经自带zsh了所以就不用再安装了。

查看默认终端 echo $SHELL

输出/bin/bash说明现在的终端是bash的

2.1 切换默认终端为zsh

执行命令chsh -s /bin/zsh将终端切换为zsh

如果想切换为默认终端,执行chsh -s /bin/bash,就可以再将终端切换为bash环境

2.2 安装配色方案

  1. 下载地址:https://github.com/altercation/solarized

  2. 进入刚刚下载的工程的solarized/iterm2-colors-solarized 下双击 Solarized Dark.itermcolorsSolarized Light.itermcolors 两个文件就可以把配置文件导入到 iTerm2 里

  3. 配置配色方案 Alt text

2.3 安装字体

  1. 下载地址:https://github.com/powerline/fonts

  2. 进入到项目目录,执行./install.sh指令安装所有Powerline字体

  3. 配置字体 Alt text

3. oh-my-zsh 安装

自动安装执行

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

手动安装

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

3.1 使用agnoster主题

打开.zshrc文件,然后将ZSH_THEME后面的字段改为agnosterZSH_THEME="agnoster"agnoster即为要设置的主题)

转载请注明出处:
文章地址: Mac下终端改造方案
作者: mraxu

Linux 调整根目录大小

要将整个 1073.7 GB 磁盘空间分配给 `/dev/mapper/centos-root`(根目录),需结合 LVM 的物理卷(PV)、卷组(VG)和逻辑卷(LV)操作。以下是详细步骤:---### **关键问题分析**1. **当前根目录大小**:328.6 GB(...… Continue reading

chrome 默认新标签页打开

Published on May 26, 2022

MTR 工具使用说明与结果分析

Published on April 29, 2022