Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

为什么在.bashrc脚本中的“HISTFILE”选项中指定的自定义历史文件无效呢?

Solution Verified - Updated -

Issue

为什么在.bashrc脚本中的“HISTFILE”选项中指定的自定义历史文件无效呢?但是users的.history文件就有效。

[test@example ~]$ more .bashrc
# .bashrc

# Source global definitions

if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific aliases and functions

export HISTFILE=/var/log/history/.test_bash_history
export HISTFILESIZE=5000
export HISTSIZE=5000
export HISTTIMEFORMAT="%F %T "

Environment

  • Red Hat Enterprise Linux 4,5,6
  • bash

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.