是~/.bashrc
唯一指定用户特定环境变量、别名、PATH
变量修改等的地方吗?
我问是因为这似乎~/.bashrc
是bash
-only,但其他 shell 也存在......
不管我把HISTSIZE
环境变量设置的多少大于5000,使用history
内置打印历史列表时,它只打印最近的5000条命令。我需要它,因为我经常有一个.bash_history
超过 5000 行的大命令,有时需要通过按 来处理早期命令Ctrl-R,但如果该命令早于 5000 个以上的命令,我将无法使用该机制访问它。我知道我可以grep
在 上使用.bash_history
,但我认为该Ctrl-R机制会更快(也更方便)。我使用 gnu bash 4.1 版。
这是我的 .bashrc 文件的全部内容:
#!/bin/bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and …
Run Code Online (Sandbox Code Playgroud)