我刚刚安装了El Capitan的新副本。我意外地删除了.bash_history,所以我只是做了一个 touch .bash_history
再次,希望这将解决我关闭和重新打开终端时不记得我的bash历史的问题。
但事实并非如此。我不明白为什么。
Macbuech:~ josh$ ~/.bash_history
-bash: /Users/josh/.bash_history: Permission denied
Macbuech:~ josh$ ls ~/.bash_history
/Users/josh/.bash_history
Macbuech:~ josh$ echo $HISTSIZE
500
Macbuech:~ josh$ echo $HISTFILESIZE
500
Macbuech:~ josh$ echo $HISTFILE
/Users/josh/.bash_sessions/9817540A-F021-4E1A-93A1-B322BC4738AB.historynew
Macbuech:~ josh$ echo $HISTTIMEFORMAT
我摆弄了一下 .bash_profile
据说,让一些颜色有效 本文 :
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
我再次删除所有的东西,以确保问题不在那里。所以这是我的 .bash_profile
:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
这个网站 说RVM可能有问题,我尝试添加一个 .bash_logout
同 shell_session_update
在其中,但没有成功。
任何帮助都非常感谢。
这是我完整的环境:
Macbuech:~ josh$ env
rvm_bin_path=/Users/josh/.rvm/bin
TERM_PROGRAM=Apple_Terminal
GEM_HOME=/Users/josh/.rvm/gems/ruby-2.2.4
SHELL=/bin/bash
TERM=xterm-256color
IRBRC=/Users/josh/.rvm/rubies/ruby-2.2.4/.irbrc
TMPDIR=/var/folders/sq/92dr708946s01kttg916m6xm0000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.9AJd6SsR1y/Render
TERM_PROGRAM_VERSION=361.1
MY_RUBY_HOME=/Users/josh/.rvm/rubies/ruby-2.2.4
TERM_SESSION_ID=9817540A-F021-4E1A-93A1-B322BC4738AB
rvm_stored_umask=0022
USER=josh
_system_type=Darwin
rvm_path=/Users/josh/.rvm
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.gZZeyimp2O/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
rvm_prefix=/Users/josh
PATH=/Users/josh/.rvm/gems/ruby-2.2.4/bin:/Users/josh/.rvm/gems/ruby-2.2.4@global/bin:/Users/josh/.rvm/rubies/ruby-2.2.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/josh/.rvm/bin
rvm_loaded_flag=1
PWD=/Users/josh
_system_arch=x86_64
XPC_FLAGS=0x0
_system_version=10.11
XPC_SERVICE_NAME=0
rvm_version=1.26.11 (master)
SHLVL=1
HOME=/Users/josh
LOGNAME=josh
GEM_PATH=/Users/josh/.rvm/gems/ruby-2.2.4:/Users/josh/.rvm/gems/ruby-2.2.4@global
LC_CTYPE=UTF-8
RUBY_VERSION=ruby-2.2.4
rvm_user_install_flag=1
_system_name=OSX
_=/usr/bin/env
$ ls -la ~/.bash_history -rw-r--r-- 1 josh staff 3B Dec 31 08:38 /Users/josh/.bash_history
~/.bash_profile
,启动一个新的登录shell,检查是否有同样的问题,在你的OQ中报告。
ls -la ~/.bash_history
?也许这是权限问题?这是我的:-rw------- 1 myusername staff 10852 18 gru 20:41 /Users/myusername/.bash_history