Answers:
打开文件~/.bashrc
(或者/etc/bash.bashrc
是否应该对所有用户全局起作用)。
找到名为的变量PS1
。
只需将a \n
放在PS1
变量值的末尾。
.bashrc
文件首先,将以下行添加到~/.bashrc
文件中:
##
## INCLUDE CUSTOM `.bashrc` CODE
##
if [ -f ~/.bashrc_custom ]; then
. ~/.bashrc_custom
fi
创建自定义文件:
touch ~/.bashrc_custom`
最后打开它,并将以下行放入:
# File: $HOME/.bashrc_custom
# THIS FILE IS A USER-CUSTOM BASHRC FILE TO KEEP CLEAN THE DEFAULT ~/.barshrc FILE.
# PUT THERE ANY CUSTOM CODE MANUALLY ADDED BY YOU
# Add a new line at the end of the command prompt
#PS1=${PS1}\\n
PS1=${PS1%?}
PS1=${PS1%?}\n'$ '
下一个打开的shell会话将如下所示:
user@host:~
$ <your-next-command-will-be-rendered-here>