How do I clear my shell history in linux or unix?



  •       -c        clear the history list by deleting all of the entries
    

    Shell command history before clearing it.

    $ history
        1  history
        2  who
        3  uptime
    

    To clear the history.

    $ history -c
    

    Check history again, only the last command typed is listed.

    $ history
        1  history
    


© Lightnetics 2022