P.Brian.Mackey
P.Brian.Mackey

Reputation: 44285

How can I recall shell history?

I'm learning the hadoop technology stack and Linux at the same time. I am at hive and started creating an external table.

hive> CREATE ETERNAL TABLE users (
      >user_id INT,
      >//and so on

Notice the type-o: ETERNAL = *EXTERNAL. Is there a way to recall the history of all the stuff I typed into the shell? Then I can fix the type-o and re-run the command. I tried up arrow, but that only gives me one line.

Upvotes: 0

Views: 121

Answers (1)

M06494h
M06494h

Reputation: 154

To get the history of all the stuff that you did on the shell type in 'history' in the terminal: $ history

Output looks like as below in the attached image file.

Output for history command

And to search for a particular command in the history file you can use the following commands:

$ history | grep command-name

$ history | egrep -i 'scp|ssh|ftp'

Upvotes: 1

Related Questions