Delete command line history permanently?

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

    Code
    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

    /storage/.ash_history

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

    The command

    Code
    echo $HISTFILE

    gives me the following output

    Code
    /storage/.ash_history

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

    Code
    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 autostart.sh and shutdown.sh inside the /storage/.config folder:

    Content of autostart.sh:

    Code
    (  rm -rf /storage/.ash_history;
    ) &

    Contect of shutdown.sh:

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

    Code
    chmod +x /storage/.config/autostart.sh
    chmod +x /storage/.config/shutdown.sh

    Maybe this helps someone else but me too.