Results 1 to 10 of 10

Thread: [SOLVED] Where is History file for Bash/Terminal Commands?

  1. #1
    Join Date
    Nov 2006
    Location
    Melbourne (Victoria, OZ)
    Beans
    925
    Distro
    Ubuntu 14.04 Trusty Tahr

    [SOLVED] Where is History file for Bash/Terminal Commands?

    I use my up and down arrows a lot in the terminal, recalling previous commands so I don't have to type them, or find them in my text file of useful commands and copy/paste them. Obviously there is a history file somewhere, so can someone enlighten me as to where it is? I could then remove commands I'll never use again, and in theory should be able to create a backup with only my most-used commands and restore over the current one when need be. Cheers

  2. #2
    Join Date
    Nov 2007
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Where is History file for Bash/Terminal Commands?

    ~/.bash_history
    Pretty straightforward .
    Wish I could prove I love you, but does that mean I have to walk on water?
    When we are older you'll understand it's enough when I say so, and maybe some things are that simple.

  3. #3
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Where is History file for Bash/Terminal Commands?

    /home/username/.bash_history

  4. #4
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Where is History file for Bash/Terminal Commands?

    There is a utility (I can't remember it's exact name, but you can search in the forums for "top ten" commands) that sorts/counts your history file and prints out your top-ten list. It's helpful to cut-and-paste this list over time to a stickie for reference.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  5. #5
    Join Date
    Nov 2006
    Location
    Melbourne (Victoria, OZ)
    Beans
    925
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Where is History file for Bash/Terminal Commands?

    Cool. Never noticed that hidden file before. Now I'll just have to figure out how to write a little script that will replace that with a backup copy. Cheers

  6. #6
    Join Date
    Jun 2007
    Location
    Melbourne, Australia
    Beans
    1,171

    Re: Where is History file for Bash/Terminal Commands?

    Also, for a neat trick to search your bash history press ctrl+r then type the start of the command you're looking for.

  7. #7
    Join Date
    Dec 2006
    Beans
    485
    Distro
    Hardy Heron (Ubuntu Development)

    Re: [SOLVED] Where is History file for Bash/Terminal Commands?

    Wow, what an awesome trick. I'm very glad I stumbled onto this thread.

    Russo
    Macbook Pro C2D
    Ubuntu 8.04

  8. #8
    Join Date
    Jun 2007
    Location
    Melbourne, Australia
    Beans
    1,171

    Re: [SOLVED] Where is History file for Bash/Terminal Commands?

    There's a thread full of them!

    http://ubuntuforums.org/showthread.php?t=204382

  9. #9
    Join Date
    Jul 2009
    Location
    Columbus, OH
    Beans
    15
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: [SOLVED] Where is History file for Bash/Terminal Commands?

    After I upgraded to new LTS I was getting worried I would have to search all forum again for "tricks" but now I just went into file from my previous LTS of Ubuntu and got all of commands ... VERY COOL ! I love Ubuntu more and more.
    Thanks a bunch guys.

  10. #10
    Join Date
    Nov 2006
    Location
    Melbourne (Victoria, OZ)
    Beans
    925
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: [SOLVED] Where is History file for Bash/Terminal Commands?

    Don't forget you can make "aliases" to save typing long and complicated commands:

    http://ubuntugenius.wordpress.com/20...-bash-aliases/
    Soylent Green is PEOPLE!!!

    =D> First Stop for Ubuntu Newbies

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •