mac如何打开更新.bash_profile文件(简短terminal命令和字体颜色)

我自己用bash_profile主要用来将常用的命令简写,更改一些主要信息的颜色。

1、打开terminal(终端)

2、cd ~ 

3、open .bash_profile (打开.bash_profile文件,如果文件不存在就  创建文件:touch .bash_profile  编辑文件:open -e bash_profile)

4、直接更改弹出的.bash_profile文件内容

5、command + s 保存文件,然后关闭

6、在terminal(终端)中输入 source .bash_profile (使用刚才更新之后的内容)//很重要的一步哟


贴上我目前的配置:
alias ll='ls -al'
alias ng='sudo nginx'
alias ngr='sudo nginx -s reload'
alias ngs='sudo nginx -s stop & sudo nginx'
alias cl='clear'
alias tcp='lsof -n -P -i TCP -s TCP:LISTEN'
alias ipconfig='ifconfig | grep "inet " | grep -v 127.0.0.1'
alias maven='mvn clean package -Dmaven.test.skip=true'
alias cp='git cherry-pick'
alias gp='git push'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '


alias proxy='sudo /usr/local/sbin/privoxy /usr/local/etc/privoxy/config'
function proxy_on() {
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    export http_proxy="http://127.0.0.1:1087"
    export https_proxy="http://127.0.0.1:1087"
    echo -e "已开启代理"
}
function proxy_off(){
    unset http_proxy
    unset https_proxy
    echo -e "已关闭代理"
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值