Is there a way that I could reference the same path from one command to the next? For example, I may want to list the contents of a specific folder:
$ ls ~/Documents/some/dir
Then, once I've done that, I may want to perform some action in that same directory:
$ mv ~/Documents/some/dir/file.txt ~/Documents/other/dir
Is there a way to, essentially, invoke that path without typing it again (or using some sort of auto-suggestion or auto-fill that I can do with .zsh)?
I vaguely remember reading about something along these lines but I don't remember what the technique is?
$_
variable (?). That is pretty much what I'm looking for although Stéphane'sinsert-last-word
suggestion also helpful. – Paul Jacobson Dec 12 '17 at 10:56$_
variable too ;-). The linked question also mentions the Alt-. shortcut. (When an existing question’s answers apply to a new question, we prefer linking them. It’s not supposed to reflect negatively on the new questions and answers, it’s just the way things are done here.) – Stephen Kitt Dec 12 '17 at 11:34$_
variable (although I did miss that the first time I read his answer). I appreciate the clarification and the link to the other question. – Paul Jacobson Dec 12 '17 at 11:37