Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The command

history | grep "keyword2find"

does not gives unlimited history that i typed in the terminal onwards i installed ubuntu. I want to see all of them without a time span.

share|improve this question
    
Why dont you look at the .bash_history file in the home folder of whatever user you are wanting to look at. –  user93329 Sep 28 '12 at 19:09
add comment

2 Answers 2

up vote 1 down vote accepted

By default history command, which uses ~/.bash_history file to store command, store only last 2000 commands. So, It doesn't give you unlimited result.

To increase the size, open .bashrc file with this command gedit ~/.bashrc and change the line to increase value

HISTSIZE=1000
HISTFILESIZE=2000

HISTSIZE refers to the number of commands stored.
HISTFILESIZE refers to the number of line contained in the history file.

share|improve this answer
add comment

Use history number | grep keyword the number here refers to how many previous history should be fetched. Example: history 500 will fetch last 500 command of your bash history.

To extend your bash history recording add the below lines to your .bashrc file.

export HISTSIZE=9000
export HISTCONTROL=erasedups

First line tells how many history lines should be recorded.

By using the second line you can avoid duplicate history lines.

Also, to search the history easily you can use Ctrl+R which give a prompt like ! Where in you can type the keyword which you would like to search.

How this helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.