Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whats the meaning, or what it does:

set -o emacs 

?

I saw it somewhere, and I a emacs user, so It make me curious.

share|improve this question
up vote 7 down vote accepted

set -o emacs tells the shell to understand Emacs editing commands.

That is, you can use Emacs commands at your shell prompt and they will work as expected. For example:

  • Use CtrlK to delete a line.
  • Use CtrlT transpose two chars.
  • Use MetaP to delete a word.
  • Use CtrlP to go to the previous line, that is, the previous command.

(More commands here, note that not all will work because not all make sense at the command line.)

set -o emacs works with bash and ksh. Other Bourne-based shells may include this functionality, too.

At least for bash, emacs is the default editing mode. You can also choose vi with set -o vi.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .