ubuntu终端只显示当前目录

需求

终端前缀提示符显示全部路径太长,影响使用。希望将

sun@ubuntu:~/work/linux_apue/Application/linux_socket/tcp/non_blocking_poll$

显示成

sun@ubuntu:non_blocking_poll$ 

解决办法:

修改~/.bashrc文件,将标红的地方由w更改为W,之后source ~/.bashrc

60,62行会影响本地打开的终端显示
69行会影响远程登陆终端(如ssh)的显示
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40209493/article/details/129173010
今日推荐