5 ms·
$ echo foo bar foo bar $ echo !$ echo bar bar The bang syntax is for history expansion, so it won't work on directories directly. But you coul
by falcolas 9y ago
$ echo foo bar
foo bar
$ echo !$
echo bar
bar
The bang syntax is for history expansion, so it won't work on directories directly. But you could hack that with something like:
$ls /root/my-dir
[...]
$echo !:t
echo my-dir
my-dir