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

I know that the command say "something" in mac's terminal would make it say stuff. I am new to Unix and since OS X is UNIX based, I was trying to teach myself the commands and I read that !5 would recall the last five commands in the terminal's history. when I typed that, the terminal started saying stuff! is this supposed to happen?

share|improve this question

migrated from Dec 31 '12 at 2:01

This question came from our site for professional and enthusiast programmers.

Search the bash manpage for "HISTORY EXPANSION"... – dmckee Dec 31 '12 at 1:45
Are you sure you didn't press Command+F5? – Luigi R. Viggiano Dec 31 '12 at 1:47
Type history and see what the 5th command was. !# would run whatever # you entered (not the last five, just the fifth). So it should call whatever number. Did you run say ... as that number? – nerdwaller Dec 31 '12 at 3:21

If you press !5 (bang-5) at the command line, if you are in a CSH'll cause the 5th command since the particular shell invokation was started entered to be recalled and executed as if you entered it on the command line.

Depending on what the 5th command in your particular case was, you'd be seeing the output from that command.

share|improve this answer
Ditto for bash(1), and I believe other shells too. – vonbrand Jan 23 '13 at 18:51

You must log in to answer this question.