Ever find yourself using the terminal in Linux or OS X? Well then you should love these next 6 tips, please note I am not using single quotes they are really back ticks(`) which is located above the tab key:

  1. Lost Bash History: Ever have multiple terminals open? Well if you have and looked at the history when you were done you will know that it does not record everything to fix that:
    1. Open ~/.bashrc your favorite text editor and add the following lines:
    2. shopt -s histappend
    3. PROMPT_COMMAND=`history -a`
  2. Duplicate Entries: Ever type cd .. so many times in a row it fills up ur history and creates a pain when reading it? Well this will fix that:
    1. Open ~/.bashrc your favorite text editor and add the following lines:
    2. export HISTCONTROL=”ignoredups”
  3. Stupid Mistakes/Typos: We all do it. Ever type bni instead of bin? Or perhaps cd cd /home? Well this one will fix those simple errors:
    1. Open ~/.bashrc your favorite text editor and add the following lines:
    2. shopt -s cdspell
  4. Split Up Multi-Line Commands in History: Lets face, it writing multiple commands on one line is easy to write but hard to read; this will turn multi line commands into single line ones:
    1. Open ~/.bashrc your favorite text editor and add the following lines:
    2. shopt -s cmdhist
  5. Search Through History with Ctrl+R instead of Pressing Up: Ever push up until you get that command you’re looking for? Well push Ctrl+R and start typing the command when you see it just hit enter!
  6. Use - as your last Directory: When switching around directories you can use - to be your last directory just like ~ is you home directory. Great for copying files!
Leave a Reply