Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It's !:h - not just a plain :h

    $ echo foo /bar
    foo /bar

    $ !:h
    echo foo
    foo
It's under `man bash` in the History Expansion section.


view as:

That's not quite what the author was talking about; your example does the same thing as !:0-

This is what the author meant:

  $ echo foo/bar
  foo/bar

  $ !:h
  echo foo
  foo

Legal | privacy