Ubuntu 根目录 .bashrc 文件

Ubuntu 根目录 .bashrc 文件

我正在安装虚拟机

并且由于某些原因,我更改了根目录的第一行,.bashrc 那里有什么?

然后我插入if [[ -n "$PS1" ]];并发现我是 root,无法撤消...对于 root 来说,在 Ubuntu 12.04 中,第一个字符串是什么样的?

答案1

我不太清楚你做了什么以及为什么这样做,但我相信这是你想要的(注意:取自 12.10 - 应该类似):

ace@ace2:~/src$ sudo head -n 20 /root/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.

相关内容