diff options
| author | srdusr <[email protected]> | 2023-02-17 23:45:55 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2023-02-17 23:45:55 +0200 |
| commit | 231b346395ec77f3f7f5655ebab7aee4dd5dd1ce (patch) | |
| tree | 99e97927e7894df1b8c6b76ae8fa20a0b971dd07 | |
| parent | 2264cc243a156f8d4d90d1c3b809e496a48149a7 (diff) | |
| download | notes-231b346395ec77f3f7f5655ebab7aee4dd5dd1ce.tar.gz notes-231b346395ec77f3f7f5655ebab7aee4dd5dd1ce.zip | |
Add more information about recalling previous commands
| -rw-r--r-- | linux/linux-commands.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/linux/linux-commands.md b/linux/linux-commands.md index 14539a0..3ae5235 100644 --- a/linux/linux-commands.md +++ b/linux/linux-commands.md @@ -39,6 +39,19 @@ NOTE: `.` can also be used but is limited $ ls -l /opt/myFile.txt -rw-r--r-- 1 root root 0 Dec 21 16:20 /opt/file.txt ``` + + `!!:n` where n is the 0-based position of the argument you want. +The ! prefix is used to access previous commands. + +- Other useful commands: + + `!$` - last argument from previous command + `!^` - first argument (after the program/built-in/script) from previous command + `!*` - all arguments from previous command + `!!` - previous command (often pronounced "bang bang") + `!n` - command number n from history + `!pattern` - most recent command matching pattern + `!!:s/find/replace` - last command, substitute find with replace - - - #### Getting information about a window |