0

We want to remove the list of commands that were run in the past in the New Command window.

It is the AutoFill or AutoComplete history of commands.


To see them, follow these steps:

  1. Launch Terminal
  2. Open Shell menu, and click on New Command

If it is empty, type something and run it. The next time you open the New Command, you'll be able to see the prior commands because it is stored in the dropdown list of the New Command window.


Any idea on how to clear these?

This history has to be erased

0

If you run this command :

open -a Finder ~/Library/Preferences/com.apple.Terminal.plist

You'll see a CommandHistory tab where you can remove entries.

If com.apple.Terminal.plist is not in above path, you can search it by :

find ~ -name com.apple.Terminal.plist
| improve this answer | |
  • A file by that name does not exist. – Muhammad Asif Mohtesham Dec 31 '19 at 18:30
  • Do you have ~/Library/Preferences directory ? Does it contain com.apple.*.plist files ? – Philippe Dec 31 '19 at 18:54
  • Yes, and yes. The directory exists, and so do those com.apple.*.plist files. But the specific file you referenced to be edited, that file does not exist. – Muhammad Asif Mohtesham Dec 31 '19 at 18:58
  • First of all, I am sorry that I didn't run the command you originally posted because I proceeded to check if the file exists in that directory using Finder. Second, after running the find command, I find that the file exists in the location you suggested, Home > Library > Preferences. But, using Finder to explore the directory, the file is not listed. This is bizarre. Third, had to search for the bits to be deleted, but it did work. Thanks. – Muhammad Asif Mohtesham Dec 31 '19 at 19:34
  • Yes, ran it. That is how we edited the file. The past commands list is gone now. – Muhammad Asif Mohtesham Dec 31 '19 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.