Skip to content

Friday, December 4th, 2009

New Linux User

HOWTO: Use Bash More Effectively Part 1

April 6, 2006 by Jon  
Filed under How To

I recently decided to take my LPI exams and ordered a couple of books to prep for it. The first one I’m reading is the LPI Linux Certification In a Nutshell by Jeffrey Dean. The book starts by jumping right into bash commands. So, guess what? You get to learn along with me.

I think that most of us know that pressing the up and down arrows while in the shell (or terminal window or command prompt) will iterate you through the last 500 commands you’ve typed. Those commands are stored in your ~/.bash_history file.

What I didn’t know is that there’s a whole lot of other ways to iterate through your bash history. A lot of the commands are really arcane, but some of the more interesting ones are:

  • control-p: previous command in history ->same as up arrow
  • control-n: next command in history -> same as down arrow
  • control-a: go to the beginning of the line
  • control-e: go to the end of the line
  • control-l: clear the screen
  • alt-d: delete the word (actually ‘meta key’ and d – may not be your alt key

By far the most useful is control-p and control-n. Very cool.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot
  • E-mail this story to a friend!

Comments

2 Responses to “HOWTO: Use Bash More Effectively Part 1”
  1. warren says:

    this is natural for emacs users — those same commands do the analogous operation in emacs.

  2. Jon says:

    Which came first? The BASH or Emacs?

    :)

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2009 b5media. All rights reserved.