Strip Bash History Line #s, & you want more bash history than the default – try this in your .bashrc

Want more bash history than the default – try this in your .bashrc.  Then save them to a file with no line #s.
[grid@prim12102 ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# add these to lines to your .bashrc 1st stops overwrites, 2nd line sets file size large
shopt -s histappend
HISTFILESIZE=1000000
******
Then lets say you want to save that history off some where without line numbers, try this:
history | cut -c 8- > /tmp/myHistory.txt
Hope this helps, Mike

Leave a Comment

Scroll to Top