4

When accessing the command line by pressing Alt+F2 it opens the dash and displays a history of previous commands which have been entered. How can this history be removed?

I've tried using Activity Log Manager but that only seems to be relevant to deleting the history of recent files rather than these commands.

enter image description here

0

2 Answers 2

6

You can clear Alt+F2 history in dconf editor.

Install dconf editor:

Hit Alt+Ctrl+T and run the following command:

sudo apt-get install dconf-tools

Or search for "dconf-tools" in Software Center and install it from there.

Clearing History:

Once installed, Hit super key (windows key) to open Unity dash and search for "dconf editor" and open it.

Navigate to Desktop > Unity > runner and click on "Set to default" in lower right corner. That's it!

enter image description here

2
  • I found that this doesn't take effect until you log out and then back in - and if you do anything to change the value in the meantime like running another alt-F2 command, the entire old value will be persisted back to dconf, so edit the value, log out, and then back in again.
    – Adrian
    Nov 13, 2020 at 13:55
  • In ubuntu 20.04 it's org.gnome.shell.command-history Sep 5, 2021 at 8:18
0

1.How to delete history without any trace

history -d $((HISTCMD-1)) && history -d NO_of_History_you_want_to_delete

2.if you want to excute a command without leaving any trace.

history -d $((HISTCMD-1)) && type_your_command_here_and_execute

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .