Terminal - Clear previous commands on current tab only

Discussion in 'Mac Apps and Mac App Store' started by muthuveerappan, May 6, 2009.

  1. muthuveerappan macrumors newbie

    Joined:
    Aug 17, 2008
    #1
    Hi,

    I work on multiple tabs on the terminal, and I want to clear the previous commands typed in the current tab of the terminal window.

    Is there a way to do this ?

    Note - I don't want to clear the command history on all the tabs of the terminal.

    Thanks in advance.

    Regards,
    Muthu
     
  2. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
  3. muthuveerappan thread starter macrumors newbie

    Joined:
    Aug 17, 2008
    #3
    If I am not wrong, the command clear would only clear the screen.

    I am looking for something to clear the previous commands (clear previous commands in the current tab only)
     
  4. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #4
    ah sorry the exact opposite of what you wanted? in your home directory rm .bash_history
     
  5. muthuveerappan thread starter macrumors newbie

    Joined:
    Aug 17, 2008
    #5
    but that would remove the history of commands in all tabs.

    I want to delete the history of the commands specific to a tab.

    Not sure it is possible in the first place.

    I guess rm .bash_history would be the only possible solution.

    Thanks a lot!
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Yea, I think Terminal/Bash only has the one history file so I don't believe it keeps separate tabs/windows separate in terms of command histories. I'm not at my Mac to try though. You could always issue a few commands in each tab (different commands) and print out the bash history file to see what's going on in there.
     

Share This Page