9951 explained code solutions for 126 technologies


ubuntuHow to clear all commands from history


history -cctrl + c
history

prints entire commands history for current user

-c

will delete all entries from terminal history


Usage example

HISTTIMEFORMAT="%F %T " && history
output
 2000  2022-02-02 16:47:53 history --help
 2001  2022-02-02 16:49:03 history | tail -n 10
 2002  2022-02-02 16:51:45 history | grep "git"
 2003  2022-02-02 16:52:56 HISTTIMEFORMAT="%F %T " && history