Expand your bash history to 2500

Expand your .bash_history to 2500

I do alot of testing and alot of work on Centos servers. I like to check my .bash_history for previous commands and to check what others have done on my server., The default .bash_history is set to 500 commands. So I wanted to expand this to include the last 2500 commands.

You can do this two ways:

Per User: Local .bashrc

If you are a single user on the system without sudo or root, you can adjust this value in your .bashrc file.

cd 
vim .bashrc

Add the following lines, remember you can make this any value, I just used 2500

HISTFILESIZE=2500

Per Server: Server wide bashrc

If you are the root user or have sudo you can edit the system wide bash file

vim /etc/bashrc

Now add the same line as above to the top of the file

HISTFILESIZE=2500

Now everyone will have a history of 2500 commands, unless they set it to something else

  • bash history
  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

What do I do if my VPS is offline or down?

Your VPS may be down or offline for a variety of reasons. In this article, we'll show you how to...

What kind of IPv6 support do you have?

Since OBHost operates out of multiple locations and datacenters, our IPv6 support varies per...

Setup vsftp with SELinux

Howto Setup vsftp with SELinux Vsftpd is a fast and secure FTP server. Installing an FTP server...

Setup Nginx PHP FPM Percona Mysql

Setup Nginx + php-fpm + Percona Mysql LEMP stack is a group of open source software to get web...

MySQL - Check Which Query is Consuming Resources

MySQL - Checking Which Query is Consuming Resources   Have you ever wondered which...

Powered by WHMCompleteSolution