Delete command line history permanently?

  • How can I delete the whole command line history permanently?

    1. cat /dev/null > ~/.bash_history && history -c && exit

    seems not to work as there is no ~/.bash_history file.

    Also, if there is a way, how can I make this automatically evertime I logout from command line?

    Thank you in advance.

  • Delete


    Thank you, this works for a one-time erase. But what I really want is to disable history completely.

    The command

    1. echo $HISTFILE

    gives me the following output

    1. /storage/.ash_history

    so I've tried the following command which is being executed without any error

    1. unset HISTFILE

    but after exit and login via SSH the /storage/.ash_history file is being created again.

  • Well, after messing around with this a while now I did not found the solution but I want to share my workaround with you which will delete the according history file on every system startup, system halt, system reboot and system poweroff/shutdown:

    According to this tutorial I have created the two files and inside the /storage/.config folder:

    Content of

    1. ( rm -rf /storage/.ash_history;
    2. ) &

    Contect of

    After creating those files with the according content make both files executable:

    1. chmod +x /storage/.config/
    2. chmod +x /storage/.config/

    Maybe this helps someone else but me too.