Delete command line history permanently?

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

    Code
    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

    /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
    1. echo $HISTFILE

    gives me the following output

    Code
    1. /storage/.ash_history

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

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


    Content of autostart.sh:

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


    Contect of shutdown.sh:


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

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


    Maybe this helps someone else but me too.