小编Mar*_*ger的帖子

有没有办法将 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万
查看次数

如何在 Linux 中使用 iptables 限制局域网上特定用户的互联网访问

假设 LAN 上有两个用户,A 和 B。如何使用 iptables 规则限制用户 A 访问 Internet 并保存规则,以便重新启动后它们仍然有效。还假设我想在某个时候授予该用户访问权限;我如何再次启用它?我正在使用 Ubuntu Linux 10.04。如果有人告诉我如何从命令行执行此操作,那就太好了,因为我经常使用本地 ssh 登录名登录到机器。

linux users iptables internet

13
推荐指数
1
解决办法
1万
查看次数

标签 统计

linux ×2

bash ×1

internet ×1

iptables ×1

shell ×1

users ×1