Lars Wiegman

  • Home
  • Skills
  • Contact
  • Blog

Shell history expansion

posted on November 13, 2018 #

Shells like Bash and Zsh support all kinds of expansions. One I use on a daily basis is the history expansion which expands to the last word of previous command in history. The next example would open my editor with ‘new.txt’ file.

% cp old.txt new.txt
% vim !$
  • Home
  • Skills
  • Blog
  • Contact
  • •
  • Archive
  • Feed
  • GitHub

Copyright © 2007-2024 Lars Wiegman