The "^[." (esc-.) keybinding. In zsh it maps to insert-last-word which allows you to do this:
echo hi > /tmp/blah.txt
ls -l <esc-.>
There's a bunch of complementary commands to go with it too.