Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:53:25+00:00 2026-05-26T21:53:25+00:00

I’d like to be able to look through my command history (all the way

  • 0

I’d like to be able to look through my command history (all the way back to the beginning of the user).

Is there any guarantee that file .bash_history will continue to be appended to?

If there is a limit where the file will start to be truncated (hopefully from the beginning), is there a way to remove that limit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:53:26+00:00Added an answer on May 26, 2026 at 9:53 pm

    There are a number of environment variables that control how history works in Bash. Relevant excerpt from bash manpage follows:

    HISTCONTROL
           A colon-separated list of values controlling how commands are saved on the history list.  If the list of values includes ignorespace,  lines  which
           begin  with  a space character are not saved in the history list.  A value of ignoredups causes lines matching the previous history entry to not be
           saved.  A value of ignoreboth is shorthand for ignorespace and ignoredups.  A value of erasedups causes all previous  lines  matching  the  current
           line  to be removed from the history list before that line is saved.  Any value not in the above list is ignored.  If HISTCONTROL is unset, or does
           not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of HISTIGNORE.   The  second  and
           subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.
    HISTFILE
           The  name  of the file in which command history is saved (see HISTORY below).  The default value is ~/.bash_history.  If unset, the command history
           is not saved when an interactive shell exits.
    HISTFILESIZE
           The maximum number of lines contained in the history file.  When this variable is assigned a value, the history file is truncated, if necessary, by
           removing  the  oldest entries, to contain no more than that number of lines.  The default value is 500.  The history file is also truncated to this
           size after writing it when an interactive shell exits.
    HISTIGNORE
           A colon-separated list of patterns used to decide which command lines should be saved on the history list.  Each pattern is anchored at the  begin-
           ning  of  the line and must match the complete line (no implicit `*' is appended).  Each pattern is tested against the line after the checks speci-
           fied by HISTCONTROL are applied.  In addition to the normal shell pattern matching characters, `&' matches the previous history line.  `&'  may  be
           escaped  using  a  backslash; the backslash is removed before attempting a match.  The second and subsequent lines of a multi-line compound command
           are not tested, and are added to the history regardless of the value of HISTIGNORE.
    HISTSIZE
           The number of commands to remember in the command history (see HISTORY below).  The default value is 500.
    

    To answer your questions directly:

    No, there isn’t a guarantee, since history can be disabled, some commands may not be stored (e.g. starting with a white space) and there may be a limit imposed on the history size.

    As for the history size limitation: if you unset HISTSIZE and HISTFILESIZE:

    unset HISTSIZE
    unset HISTFILESIZE
    

    you’ll prevent the shell from truncating your history file. However, if you have an instance of a shell running that has these two variables set, it will truncate your history while exiting, so the solution is quite brittle. In case you absolutely must maintain long term shell history, you should not rely on shell and copy the files regularly (e.g., using a cron job) to a safe location.

    History truncation always removes the oldest entries first as stated in the man page excerpt above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.