I have two commands I execute frequently. Let's say the first is 'abcd' and the second is 'abc'. So my history contains
1000 abc arg1 arg2 arg3 1001 abcd arg1 arg2 arg3
Now if I type '!abcd' in bash, it executes the abcd command. which is fine. But if I type '!abc' in bash, it also executes the last abcd command (since it matches the beginning and is 'newer')
How do I use bash history to grab the last abc command? I've tried !'abc ' and "!abc\ " backslashing the space.