Hi,
I want to export bash history to a file, I used the following command
history > /home/administrator/bashHistory
But the exported file only contains commands with line number from 996 to the last one, How to export all the commands including commands before line 996?
The man page for history says that using a negative number as the first parameter on the command line (e.g. -1000) will print the most recent (1000 in this example) lines. This isn't working with my version of bash.
Bash keeps it's history in the clear, so you should be able to run this command:
grep -v "^#" $HISTFILE >output-file
Hope this helps a bit.
EDIT:After some playing history 10000 printed my complete history (which is less than 10000 lines).