我读到,为了不将 bash 命令保存到.bash_history
,您在前面放了一个空格。这适用于我所有的嵌入式 Linux PC,但不适用于我的 Ubuntu 18.04 LTS 桌面。我只是认为这是一个 Ubuntu 的“怪癖”之类的。现在我已经安装了第二台带有 Ubuntu 18.04 LTS 的 PC,它按预期工作:前面有空格的命令没有保存!
所以第一台装有 Ubuntu 18.04 LTS 的 PC 可能有问题。如何找出导致此问题的原因并对其进行修复,以便它不会保存带有空格的 bash 命令?
摘抄:
mark@mark:~$ tail -n 5 .bash_history
./deploy.sh
./deploy.sh
upd
man ls
nano .bash_history
mark@mark:~$
可能有用的东西:
mark@mark:~$ cat .bashrc
alias upd="sudo apt update && sudo apt upgrade && sudo apt autoremove"
export PATH="$PATH:"/opt/microchip/xc8/v1.44/bin""
mark@mark:~$ printenv
CLUTTER_IM_MODULE=xim
LC_MEASUREMENT=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
XDG_MENU_PREFIX=gnome-
KIGITHUB=https://github.com/KiCad
LANG=en_US.UTF-8
MANAGERPID=1252
DISPLAY=:0
INVOCATION_ID=26457eadc1b8429692b7f3bd70c6464f
UNITY_DEFAULT_PROFILE=unity
COMPIZ_CONFIG_PROFILE=ubuntu
GTK2_MODULES=overlay-scrollbar:overlay-scrollbar
GTK_CSD=0
COLORTERM=truecolor
ZEITGEIST_DATA_PATH=/home/mark/.local/share/zeitgeist
USERNAME=mark
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
MANDATORY_PATH=/usr/share/gconf/unity.mandatory.path
LC_NAME=en_US.UTF-8
USER=mark
DESKTOP_SESSION=unity
QT4_IM_MODULE=xim
TEXTDOMAINDIR=/usr/share/locale/
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/24f3cfef_6815_4cfb_8cdc_6c63814db4b6
DEFAULTS_PATH=/usr/share/gconf/unity.default.path
PWD=/home/mark
HOME=/home/mark
JOURNAL_STREAM=9:1719321
TEXTDOMAIN=im-config
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
COMPIZ_BIN_PATH=/usr/bin/
XDG_DATA_DIRS=/usr/share/unity:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_SESSION_DESKTOP=unity
LC_ADDRESS=en_US.UTF-8
SSH_AGENT_LAUNCHER=gnome-keyring
LC_NUMERIC=en_US.UTF-8
GTK_MODULES=gail:atk-bridge:unity-gtk-module
PAPERSIZE=letter
WINDOWPATH=3
GNOME_SESSION_XDG_SESSION_PATH=
TERM=xterm-256color
VTE_VERSION=5202
SHELL=/bin/bash
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
IM_CONFIG_PHASE=2
XDG_CURRENT_DESKTOP=Unity:Unity7:ubuntu
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GNOME_TERMINAL_SERVICE=:1.617
UNITY_HAS_3D_SUPPORT=true
SHLVL=3
LC_TELEPHONE=en_US.UTF-8
GDMSESSION=unity
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=mark
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-unity:/etc/xdg
PATH=/home/mark/bin:/home/mark/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/microchip/xc8/v1.44/bin:/opt/microchip/xc8/v1.44/bin:/opt/microchip/xc8/v1.44/bin
LC_IDENTIFICATION=en_US.UTF-8
LD_PRELOAD=libgtk3-nocsd.so.0:libgtk3-nocsd.so.0
SESSION_MANAGER=local/mark:@/tmp/.ICE-unix/19058,unix/mark:/tmp/.ICE-unix/19058
GTK_IM_MODULE=ibus
LC_TIME=en_US.UTF-8