Categories
Linux Mastering Development

Why cannot find event string command, where it is in history?

Is there a limit in number of commands through which does event string !?command look?:

user@Host:~/Desktop/bin$ !?strace -o!
bash: !?strace -o!: event not found
user@Host:~/Desktop/bin$ history 100 | grep strace
 1964  man strace
 1989  strace -o >(vim -) a.out ##there you go, command I look after
 1990  man strace | grep -A5 "^\s*-p"
 1994  man strace | grep -A5 "^\s*-e"
 1998  man strace | grep -A5 "^\s*-e"
 2000  history 100 | grep strace
user@Host:~/Desktop/bin$ 

The even !?strace -o! was not found, yet it is in history of commands, so why?

Also, why isn’t possible to use regex in !?regex_to_find_command? ? That would make much easier to look-up already used commands. (E.g. used !?strace .*?)

Leave a Reply

Your email address will not be published. Required fields are marked *