Ubuntu中让终端只显示当前路径,而不显示绝对路径
来源:互联网 发布:腾讯云域名和ip绑定 编辑:程序博客网 时间:2024/05/29 19:43
想要将Ubuntu的终端,中的绝对路径的显示,变成当前路径(文件夹)的话,则需要去修改自己的.bashrc,将其中的小写的w,改为大写的W即可:
(1)针对终端的标题title
1
2
3
4
5
6
7
8
# If this is an xterm set the title to user@host:dir
case
"$TERM"
in
xterm*|rxvt*)
PS1=
"\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
改为:
1
2
3
4
5
6
7
8
# If this is an xterm set the title to user@host:dir
case
"$TERM"
in
xterm*|rxvt*)
PS1=
"\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \W\a\]$PS1"
;;
*)
;;
esac
(2)针对终端的当前显示prompt
1
2
3
4
5
6
if
[
"$color_prompt"
=
yes
];
then
PS1=
'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1=
'${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset
color_prompt force_color_prompt
改为:
1
2
3
4
5
6
if
[
"$color_prompt"
=
yes
];
then
PS1=
'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
else
PS1=
'${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
fi
unset
color_prompt force_color_prompt
阅读全文
0 0
- Ubuntu中让终端只显示当前路径,而不显示绝对路径
- ubuntu终端只显示当前目录,不显示当前路径
- 让Ubuntu 终端路径只显示当前目录
- UBUNTU 终端路径只显示当前目录
- ubuntu下终端路径只显示当前目录
- ubuntu下终端路径只显示当前目录
- ubuntu下终端路径只显示当前目录
- Ubuntu下终端路径只显示当前目录
- ubuntu下终端路径只显示当前目录
- Linux终端只显示当前路径
- Ubuntu终端下只显示当前目录
- ubuntu 只显示当前路径的目录
- 如何让linux终端显示/不显示 路径
- 修改PS1环境变量让shell只显示最后一个目录名而不显示完整的路径
- 让ubuntu 的命令提示符前不显示绝对路径
- ubuntu 终端显示路径太长
- Ubuntu终端路径显示设置
- 将ubuntu系统终端中显示的路径缩短
- python的Template使用指南
- Python-Image 基本的图像处理操作
- CEPH-DOKAN编译使用
- export命令与shell
- JDK8新特性☞访问局部变量测试
- Ubuntu中让终端只显示当前路径,而不显示绝对路径
- io流字节流和字符流的详细区别
- C# Dynamic关键字之:dynamic为什么比反射快的详解
- 谈谈“僵尸猎手小明”手游兼容性踩到的坑
- Recursive sequence HDU --- 5950 【公式矩阵快速幂】
- JSP实现文件上传下载和删除(附:JS获取上传文件的文件名)
- GitLab v9.3.0-rc5 发布,代码托管平台
- 接口功能测试策略(分类执行)
- webpack的基础用法