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

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

OpenVPN Tutorial For Debian/Ubuntu on OpenVZ

What is OpenVPN?OpenVPN is a reliable and well tested VPN solution that is able to run over a...

How do I SSH into my VPS? (OS X/Terminal)

If you are on a Mac, SSH-ing into your VPS is very simple. Simply launch "Terminal" by going to...

How do I SSH into my VPS? (Windows/Putty)

This article will teach you how to access your server via SSH using the PuTTY client on Windows....

Install Remi and EPEL yum repo Centos 7

Install Yum EPEL and Remi repositories on Centos 7 Adding additional useful repo's on Centos 6...

Install PHP/PHP-FPM 5.4 Centos 7

Install PHP/PHP-FPM 5.4 on Centos 7 PHP is a server-side scripting language designed for web...