The Linux
In your ~/.bashrc file, simply add some lines like:
Then, you'll have a 5000 line history file along with timestamps! Give it a go and let me know how it goes!
After you log out and back in, you'll see something like:
Everything before time/date will show the same time, but after that, it'll show you the exact times of command run.
Recently, Ubuntu and some other distros have been changing history to 2000 lines, so if you see that in your .bashrc, either comment it out, or just directly change that to 5000.
history
command is awesome by default, but you can make it better! By default, it'll only hold about 1000 past commands, but you can increase that - you can also add time/date to it so you can see when you ran each command!In your ~/.bashrc file, simply add some lines like:
Code:
HISTTIMEFORMAT="%F %T "
HISTFILESIZE=5000
Then, you'll have a 5000 line history file along with timestamps! Give it a go and let me know how it goes!
After you log out and back in, you'll see something like:
Code:
1991 2020-03-06 20:00:23 cat word_list.txt |wc
1992 2020-03-06 20:00:23 head word_list.txt
1993 2020-03-06 20:00:23 tail word_list.txt
1994 2020-03-06 20:00:23 ls
1995 2020-03-06 20:00:23 cd ..
1996 2020-03-06 20:00:23 ls
1997 2020-03-06 20:00:23 cat scripts/push-changes.sh
1998 2020-03-06 20:00:23 exit
1999 2020-03-06 20:00:23 exit
2000 2020-03-06 20:00:27 history
2001 2020-03-06 20:01:08 ls
2002 2020-03-06 20:01:10 history
Everything before time/date will show the same time, but after that, it'll show you the exact times of command run.
Recently, Ubuntu and some other distros have been changing history to 2000 lines, so if you see that in your .bashrc, either comment it out, or just directly change that to 5000.
Last edited: