From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Command history

Command history - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Command history

- Using the shell's history can keep you from having to type in commands over again. If you want to just bring up the last command you may want to use your up and down arrow keys. If you want to see what commands you've typed in use the history command by typing in 'history' into a shell. History shows the most recent commands we've typed up to the shell limit. The limit is usually 500 or 1,000 items depending on the configuration. If you want to bring back the entire last line from the history, type in '!!' and hit enter. In my case, it's the history command which we just typed in. If you want to execute the command four lines from the bottom, you'll use '!-4' and hit enter. Type in 'history' again to see the list. We can see that four lines from the bottom was the clear command, for me, for you it may be something else. If you want to run a specific line, just specify the number after the exclamation point.…

Contents