Do you want unlimited history in Linux Terminal?

History in Linux terminal is very useful if you get used to it. If you have to ssh long hostname, or long file paths you don't need to type them again and again. You can just grep your history and rip what you want like this.

Let's say I want my ssh commands I want to get.
history | grep ssh
perhaps maybe smbclient commands
history | greb smbclient
By default in Ubuntu Linux History, size is 2000 commands or something like that. That will limit you from accessing your all commands. Then you may feel sick of using history. Solution for that is making you Linux terminal history unlimited. Those days disk space is not much concern so you can save you all the history in a single file without any problem. For 7000 commands it will not take half of a MegaByte at least. Let's see how to make this history unlimited.

1. Take a terminal and type below command.
gedit ~/.bashrc
or
vi ~/.bashrc
2. Then find  below lines from gedit or vi
HISTFILESIZE=2000 
HISTSIZE=2000 
3. Change delete the number in front of equal.
HISTFILESIZE= 
HISTSIZE=
4. Save it.
5. Close and open a terminal again.

Tags

  • terminal
  • linux
  • terminal history