Some words more about Tab
Tab is great to complete a partial written command (or an option) among the available ones as just underlined by Terdon in another answer.
To complete a command is enough to press Tab once. To have the full list press Tab again.
Moreover you may like to custom the behaviour of Tab. Try for example those 2 lines:
bind "set show-all-if-ambiguous on"
The first Tab shows you all the possibilities and autocomplete the command with the first available, from the second time you press Tab it will start to cycle among them.
You can write your own bash completion scripts, with rules options...
There are more than some hints in the article An introduction to bash completion: the 1st part is for the bases and the second to write your own script.
You may find interesting
complete and the references here below.
2nd Answer: Absolute paths and shortcuts
It is not always mandatory to write the absolute path (full) in each command even if is a good practice when you write a script and you want to avoid the risk of exploit as trojan horses.
There are some shortcut to go faster as, for example, Tab, Alt+., ., ~ and a all the variables defined in the current shell.
Here below some examples (. means here and ~ means home):
To copy a file to the current directory is enough to write
cp /my/far/far/away/myfile .
To copy from your
home directory a file to the present directory you can write
cp ~/myfile .
To copy a file from the current directory to the last one
cp myfile $OLDPWD
Alt+. writes the last argument of the last command stored in the history. If pressed again it will substitute the one just found with the one of the previous position in the bash history. With an example is more simple:
cd # here press `Alt + .` and it will autocomplete with NewDir
# press `Alt + .` again and you will see "cd OldDir"
- An introduction to bash completion: part 1 and part 2
help bind, yes help because
bind is a built in command
help complete and
complete -p | less to have a list in a cosy format.
help pushd and
help popd to push and pop a directory from the stack.
- Programmable Completion Builtins