Backup your bash history to a file
Flush the history to the file
history -w historybackup.txt
where historybackup.txt is the file name where to save your history.
Clear bash history completely
Flush the history to the file
history -w
Clear the history
history -c
Count the number of file in a directory from terminal type:
find folder -type f | wc -l