4

I am working on a project that have reached over more than 3000 commands. However most of the commands of mine is repeated and generated automatically due to my program.

I have try to grep or export to file but it only displays 1000 commands recently.

Are there any ways that to have a look on those very first commands (for e.g first 500 commands).

Thanks in advance !

2
  • You can set it in the .bashrc file. Use HISTSIZE=100000 or any number You want. Remember to re-login after the change. More info check here Feb 26, 2021 at 22:51
  • @MichalPrzybylowicz many thanks ! :D I will check it out Feb 26, 2021 at 23:34

1 Answer 1

4

My new settings I have recently found and used.

zeus@buster-raspi:~$ cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

snip ....

# New history settings  https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows

export HISTCONTROL=ignoreboth:erasedups  # no duplicate entries edited to ignore the blank line start too
export HISTSIZE=100000                   # big big history
export HISTFILESIZE=100000               # big big history
shopt -s histappend                      # append to history, don't overwrite it

# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .