Become The Solution Chicago Logo

Easy: Set Mac Terminal Command History (Set How Many Lines Remembered)

Easy: Set Mac Terminal Command History (Set How Many Lines Remembered)

By default, Mac OS Terminal bash profiles remembers 500 lines of command history in shell. While 500 lines is a lot, some prefer to remember more lines of history to repeat commands. Follow the steps below to increase the HISTFILESIZE setting inside your Terminal bash profile.

 

  1. Confirm the current Terminal command history length by typing:
 
echo $HISTFILESIZE

 

A number will be displayed which will be the number of lines of commands your current bash shell is remembering.

 

Mac terminal history command lines remembered default 500

 

  1. Next, we’ll create a .bash_profile file and customize the number of lines of command history to 1000. Use any number you wish. Type:
 
vi ~/.bash_profile

 

  1. Next, type “i" to insert into the file.
 
  1. Add the following line:
 
HISTFILESIZE=2000

 

  1. Finally, type Shift + Z + Z (that’s shift key and Z key twice) to save and write out the .bash profile file. You will need to restart Terminal for the changes to take affect.
 
Mac terminal histfilsize value
 

You can issue the echo $HISTFILESIZE command to see the updated lines of command history saved now.

 

Other Useful Mac OS Terminal History Commands





List Terminal History

history

 

Clear Terminal History

history -c
history -w

 



* Please use the comment form belowFor LIVE chat updates, use the SHOUT BOX below.*



2

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Guest
Saturday, 15 December 2018


Shout Box!

HelenV - 12/12/2018 - 08:32

just got msg on my 7plus that someone is trying to sign in with my apple id in Nanjing, Jiangsu and I am in Athens Greece. Good thing I have 2 factor.

Alex - 11/12/2018 - 16:29

My TT-BH040 won't pair with another device besides my iPhone. I'm trying to pair them with my Windows 10 laptop.

iphone user - 10/12/2018 - 13:36

iphone xs max sometimes after unlocking does not switch horizontal to vertical view. I usually end up powering off and on. Latest iOS .12.1.1

Anonymous - 05/12/2018 - 23:17

Where can I get this App?

Mike - 05/12/2018 - 23:17

Hi.

User - 26/10/2018 - 08:55

Have been habving this issue last hour. Unreal hinge is trash

Follow Us Online!
Become The Solution Facebook PageBecome The Solution Twitter Solution ChicagoBecome The Solution Google PlusBecome The Solution InstagramBecome The Solution LinkedInBecome The Solution YouTube

Subscribe to Become The Solution!