Reputation: 155
Currently, I'm trying to move a file that I mistakenly saved to my home directory, and to do that I'm using a mv command. However, after I typed out the first part of my mv command:
mv lab2prog.c 111/lab/...
I forgot what directory I wanted to move the file in. Usually, I would just backspace the command and go directory exploring, but I recall a co-worker of mine browsing the directories of his system while issuing the command without having to delete the already typed command.
Is there a way to do that, or am I just imagining things...?
Upvotes: 1
Views: 109
Reputation: 2884
This depends on your shell, most shells will have completion when you hit the TAB key. The easiest way to determine the shell you are running is to echo $SHELL
.
Typically you will be using bash (/bin/bash
), this answer: How does bash tab completion work? answer gives you some more information about your options for auto-completion. It can be quite sophisticated where the command is taken into account: that is when you press TAB you get a sensible completion. Debian also have a brief introduction for bash:
An introduction to bash completion: part 1
Upvotes: 1
Reputation: 91902
Press tab twice to get a list of possible autocompletions in each step. This means you can also see a list of paths starting with, e.g., do
by issuing: mv lab2prog.c 111/lab/dotabtab
Upvotes: 1
Reputation: 126
I usually can just press the tab key to autocomplete with possible paths, though this may give you a very large output.
Upvotes: 0