如何列出所有变量名称及其当前值?
不仅包括$HOME
, $PWD
etc 还包括您定义的任何其他。
我安装了 texlive,我想将其作为环境变量添加到我的 Path 中,以便当我从 GUI 或命令行启动 emacs 时,Emacs AucTeX 可以读取它。到目前为止,我已经了解到 emacs 只读取来自~/.profile
.
因此,我的计划是将 texlive 添加到我的路径中,.profile
以使 emacs GUI 能够读取它,然后~/profile
从中获取源代码.bashrc
,以便在我的非登录交互式 GNOME 终端中启动的 emacs 查看路径。
.profile
注意:我的主目录中没有文件,仅在我的/etc
目录中,我不想碰那个文件,但我.bash_profile
的主目录中有一个文件。但是我读到它.bash_profile
仅针对交互式登录会话(即我不使用的控制台模式)运行。
.profile
文件并执行以下操作:第 1 步:创建~/.profile
步骤2:将texlive环境变量添加到path中.profile
export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH
Run Code Online (Sandbox Code Playgroud)
步骤 3:.profile
来源.bashrc
#Adding this at the bottom or start of .bashrc to source .profile when the terminal is opened.
if [-s ~/.profile]; then;
source …
Run Code Online (Sandbox Code Playgroud) 我想自定义我的 shell 提示以包含时间。所以,我做到了export PS1='\t\w\$'
。
我的提示现在看起来像18:57:37~$
. 我不知道如何在它前面加上username@hostname
.
另外,我不知道如何改变颜色的每个参数为\t
,\w
,等等。
在所有测试之后,我如何将其设置回默认值?
最后,出口线去哪儿了?我看了看~/.profile
,但没有线export PS1='\t\w\$'
。