ubuntu14.04 配置java变量不小心清除了etc/profile,怎么办?

Junior_s 2016-10-26 09:02:21
刚接触linux,新安装的ubuntu14.04单系统,配置java环境变量时用vim编辑etc/profile文件,由于操作不熟练,致使文件打开时只能看到一行代码:export JAVA_HOME=/usr/local/java/jdk1.8.0_111
,我重启了几次系统都能正常进入,但打开这个文件还只是这一行,请问这个文件影响大吗?对开发环境影响大吗?如果影响大的话?能恢复原文件吗?有热心网友说拷贝其他14.04电脑的profile文件就可以,哪位好心人有?
...全文
571 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Arnold9009 2016-10-27
  • 打赏
  • 举报
回复
引用 3 楼 u010126977 的回复:
[quote=引用 2 楼 Arnold9009 的回复:] 给你参考一下: # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi
您这个是14.04的吗?[/quote] 3.19.0-49-generic #55~14.04.1-Ubuntu SMP x64
Junior_s 2016-10-27
  • 打赏
  • 举报
回复
引用 4 楼 Arnold9009 的回复:
[quote=引用 3 楼 u010126977 的回复:] [quote=引用 2 楼 Arnold9009 的回复:] 给你参考一下: # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi
您这个是14.04的吗?[/quote] 3.19.0-49-generic #55~14.04.1-Ubuntu SMP x64[/quote] 好的 谢谢!
Junior_s 2016-10-26
  • 打赏
  • 举报
回复
引用 2 楼 Arnold9009 的回复:
给你参考一下: # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi
您这个是14.04的吗?
Arnold9009 2016-10-26
  • 打赏
  • 举报
回复
给你参考一下: # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi
  • 打赏
  • 举报
回复
最好还是重新拷贝 不行的话自己重新找台电脑安装一下,然后拷贝出来。

23,124

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧