相关疑难解决方法(0)

是否有所有 shell 读取的“.bashrc”等效文件?

~/.bashrc 唯一指定用户特定环境变量、别名、PATH变量修改等的地方吗?

我问是因为这似乎~/.bashrcbash-only,但其他 shell 也存在......

bash environment-variables profile

126
推荐指数
4
解决办法
5万
查看次数

有没有办法将 bash 中历史列表的大小设置为超过 5000 行?

不管我把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)

linux shell bash

27
推荐指数
4
解决办法
5万
查看次数

标签 统计

bash ×2

environment-variables ×1

linux ×1

profile ×1

shell ×1