bash版本号怎么样能解决

第一步: 注释掉/etc/profile中的PS1变量(如果有PS1变量,如果没有,直接第二步)

第二步:删除隐藏文件重新登录系统

root@name \~# rm -rf .bash_profile .bash

root@name \~# rm -rf .bash_profile .bashrc

root@name \~# exit

-bash-4.2#

-bash-4.2#

-bash-4.2#

-bash-4.2#

第三步:解决方法 复制模糊文件到家目录

-bash-4.2# cp /etc/skel/.* .

查看是否复制成功 .bash_profile和.bashrc

第四步: 退出重新连接操作系统

-bash-4.2# exit

第四步;如果不退出可以让profile直接运行一次

使用. 或者source

-bash-4.2# . .bash_profile

PS1变量: 临时修改

root@name \~# cd /etc/sysconfig/network-scripts/

root@name network-scripts# PS1='\\u \\t@\\h \\w\$'

root 17:43:11@name /etc/sysconfig/network-scripts#

永久修改写入/etc/profile

答: 出现以上问题是由于误删除了家目录下的隐藏文件.bash_profile .bashrc

解决方法 复制/etc/skel/目录下的隐藏文件 到家目录

然后重新连接即可

相关推荐
未济10 小时前
linux 配置环境变量
linux
傲世仙尊10 小时前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.12 小时前
进程间通信
linux
Liuqy-0513 小时前
Linux IO编程——静态库、动态库
linux
彧azz13 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅14 小时前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK14 小时前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖14 小时前
SimlpeHttp
linux·服务器
qeen8715 小时前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS15 小时前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关