From 24d3f578bd56220cde13c90c2185766bb6b734f3 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Mon, 29 Apr 2013 06:11:43 -0500 Subject: [PATCH] Added some words about the history command and bang-history # direct access. --- shell/Readme.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/shell/Readme.md b/shell/Readme.md index 012bad1..84ef756 100644 --- a/shell/Readme.md +++ b/shell/Readme.md @@ -416,6 +416,34 @@ The down arrow takes your forwards in the command history. ^-R will do a reverse-search through your command history. This is very useful. +You can also review your recent commands with the `history` command. Just enter: + + history + +to see a numbered list of recent commands, including this just issues +`history` command. You can reuse one of these commands directly by +referring to the number of that command. + +If your history looked like this: + + 259 ls *! + 260 ls /usr/bin/*.sh + 261 ls *4*1 + +then you could repeat command #260 by simply entering: + + !260 + +(that's an exclamation mark). + +* * * * +**Short Exercise** + +1. Find the line number in your history for the last exercise (listing +files in /bin) and reissue that command. + +* * * * + ## Which program? Commands like `ls`, `rm`, `echo`, and `cd` are just ordinary programs -- 2.26.2