Find the answer to your Linux question:
Results 1 to 2 of 2
Hi there, I'm trying to configure history logging in .bash_history (under Red Hat EL 5.5). I want to save 2000 command entries for user root and leave a default of ...
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    1

    Help tweaking .bash_history, please!

    Hi there,

    I'm trying to configure history logging in .bash_history (under Red Hat EL 5.5).
    I want to save 2000 command entries for user root and leave a default of 20 for the rest of the users in the system.

    I wrote the following line in the /etc/profile file:

    export HISTSIZE=20

    Besides, I've put the following in .bashrc file in root user's home:


    export HISTSIZE=2000
    export HISTFILESIZE=2000
    export HISTTIMEFORMAT='%F %T '
    export HISTFILE=~/.bash_history
    shopt -s histappend
    readonly PROMPT_COMMAND="history -a"


    I don't know what is happening but that configuration isn't working as i expected. I want to log 2000 lines in .bash_history for the user root, no matter the number of sessions opened and that file resetting every time i logout & login.

    How can i fix that? I don't want the history file to reset with each root login.

    Regards.

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    262
    put them into .bash_profile which is run when logging in as ".bashrc" is run only in "interactive" shells.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...