All Questions
Tagged with history-expansion command-line
8
questions
1
vote
2
answers
218
views
View History Expansion On History
I am having to to rewrite history expansion commands, instead of calling it from history.
For Example, I have to change 35 to 36, 37, 38.... in the following command.
$ print -P '\033[35mThis is the ...
0
votes
0
answers
244
views
How does history print to the terminal?
EDIT: As per @JdeBP's comment, I've learned that the history command and the history recall functionality of interactive terminals are two separate things. I am, however, still curious about how the ...
0
votes
1
answer
233
views
Multiple substitution when repeating the previous command
I know that I can simply substitute a string with another in the previous command by typing:
!!:gs/string1/string2/
But how I can perform multiple substitutions, e.g. having a command:
echo "...
1
vote
2
answers
371
views
Linux History Expansion escaping colon which is not mean as a modifier (in zsh)
I have a command like:
echo test
Now i want to use the last parameter inside another command with history extension inside a zsh. My other command have a leading colon ":" in it, so I want a result ...
1
vote
1
answer
371
views
printing and not executing the result of zsh history expansion on partial search
I could do:
!systemctl:p to get systemctl reload bind result printed (as last command in the history starting with systemctl string).
but doing the same with the partial search on the command ...
15
votes
5
answers
18k
views
How to recall a previous command (without execution) in order to change it?
I can't remember the trick where I could get the last command without running it:
let's say I want to be be able to access the command !1255 when pressing the up arrow key and modify the command. So ...
12
votes
2
answers
4k
views
How to access the second argument from the last command in the history ?
I am starting to learn some Regex, therefore I use this command repeatedly:
grep pattern /usr/share/dict/american-english
Only the part with pattern changes, so I have to write the long expression "...
5
votes
2
answers
7k
views
How do I get command name of the last executed command?
Example: I type man ls, than I want to get man only.
By using !! I can get man ls but how do I get man?