文章

处理终端常见及特殊问题

终端登录消除多余

终端登录提示的信息

Image

1
2
3
4
#以下这些是多余的
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

消除多余提示

1
2
3
4
5
6
7
8
9
10
11
12
13
#添加此行信息
vim ~/.bash_profile
    export BASH_SILENCE_DEPRECATION_WARNING=1

问题: 
1. 如果遇到问题需要登录密码,可能是有其他配置
    比如: root中 /etc/profile 配置
        chsh -s /bin/bash
        source ~/.bash_profile
    解决: 可屏蔽此行
        chsh -s /bin/bash
    
    

主机名变成 bogon

修改配置文件

1
2
3
4
5
6
/etc/resolv.conf

nameserver 8.8.8.8
nameserver 114.114.114.114
nameserver 192.168.0.1
nameserver 172.16.0.1

法2.更改主机/电脑名称

1
2
3
4
5
6
查看当前名称
scutil --get ComputerName
scutil --get HostName
设置自定义名称
scutil --set ComputerName 计算机名称(用户名)
scutil --set HostName 主机名称

mac-终端设置允许任何来源软件可安装

1
2
# 在终端执行
sudo spctl --master-disable

mac-使用二进制mfa报错

1
2
3
4
执行时提示:
-bash: ./mfa: Bad CPU type in executable

原因: 可能是与系统环境有关,后续安装 brew、vim、xclone等之后 又能重新执行cc了
本文由作者按照 CC BY 4.0 进行授权