Earlier quoted context omitted.
I think !$ takes the last argument on the previous command in history, not previous one on the same line.. at least in bash. For example, if you do: $ ls / $ ls /tmp/junk; rm !$ It's taking "/" rather than "/tmp/junk".. EDIT: formatting
Yes that's right it's the previous command from history. That way you run ls and see if it's the expected output, then rm to delete.
What you want is "ls /path; rm $_".
Even then, the above is fairly pointless. At the time you look at what you are deleting, it's gone.