From be83edd1b6bbecf700a72dc5d4b8e865dcbcdc9e Mon Sep 17 00:00:00 2001 From: Fred Zimmerman in Ann Arbor Date: Thu, 23 May 2019 11:41:48 -0400 Subject: [PATCH] adds :p to history notes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06ceae8..2fc123d 100755 --- a/README.md +++ b/README.md @@ -90,7 +90,8 @@ Notes: - For editing long commands, after setting your editor (for example `export EDITOR=vim`), **ctrl-x** **ctrl-e** will open the current command in an editor for multi-line editing. Or in vi style, **escape-v**. -- To see recent commands, use `history`. Follow with `!n` (where `n` is the command number) to execute again. There are also many abbreviations you can use, the most useful probably being `!$` for last argument and `!!` for last command (see "HISTORY EXPANSION" in the man page). However, these are often easily replaced with **ctrl-r** and **alt-.**. +- To see recent commands, use `history`. Follow with `!n` (where `n` is the command number) to execute again. Add +`:p` to print the command without executing, so that you can easily edit it. There are also many abbreviations you can use, the most useful probably being `!$` for last argument and `!!` for last command (see "HISTORY EXPANSION" in the man page). However, these are often easily replaced with **ctrl-r** and **alt-.**. - Go to your home directory with `cd`. Access files relative to your home directory with the `~` prefix (e.g. `~/.bashrc`). In `sh` scripts refer to the home directory as `$HOME`.