How to effectively clear your bash history

Discussion in 'all things UNIX' started by ronjor, Jun 6, 2016.

  1. ronjor

    ronjor Global Moderator

    Joined:
    Jul 21, 2003
    Posts:
    58,138
    Location:
    Texas
  2. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,519
    Well, even easier, use Bleachbit to clean up bash history and all other traces of trash, including Ubuntu Apt cache. Sometimes more than 1GB of space can be freed just by running Blachbit in user space and root mode.
     
  3. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    187
    history -c && history -w
     
  4. fblais

    fblais Registered Member

    Joined:
    Jul 31, 2008
    Posts:
    884
    Location:
    Québec, Canada
    What does the -w switch, please?
     
  5. accessgranted

    accessgranted Registered Member

    Joined:
    Mar 10, 2010
    Posts:
    187
    On certain distros the -w switch is needed to write the cleansed state into memory, otherwise you may be left with the history -c mention in the bash.
    Also, use parcellite to view and clear any clipboard content, even if you're a Bleachbit user.
     
Loading...