Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.