所以我一直想知道如何在每次关闭终端的打开实例时运行这两行代码:
history -c
cat /dev/null > ~/.bash_history
Run Code Online (Sandbox Code Playgroud)
我export HISTFILE=5在启动时,但仍然想在我完成后将其清除。
我运行 Linux Mint,并且还要注意这里我遇到了类似的问题.bash_profile;最终,我发现我需要将所有启动代码放在.bashrc. 这是我的.bash_logout文件:
#!/bin/bash
# ~/.bash_logout: executed by bash(1) when login shell exits.
#this does nothing on exit...
echo 'logout'; sleep 2s
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
history -c
cat /dev/null > ~/.bash_history
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Run Code Online (Sandbox Code Playgroud)
我已经尝试以多种方式重新安排这个脚本,我不确定我是否不明白 bash …
I don't want to get sidetracked too much here, but emacs -nw (in my opinion) ought to open a graphical instance of emacs, with a popup. However, foregoing the -nw switch will bring up the GUI, and an embedded CLI version is implied by the new window switch?
Anyway, can I make this
emacs myfunscript.py
Run Code Online (Sandbox Code Playgroud)
run as this
emacs myfunscript.py -nw
Run Code Online (Sandbox Code Playgroud)
and keep my business on the command line, where I've grown to like it?
Thanks.