Tag Archives: unix

Auto-completing filenames

The shell if filled with shortcuts and tricks, but there a vital feature you can’t miss at all: the auto-completion (see what says Wikipedia about it). In a few words if you start typing a filename or command an you press [Tab] once it will be automatically completed. If more than a file exist that starts with the characters you typed, double [Tab] prints a list of possibilities.

This is much more than a trick: it’s a safe way to check that you are giving the right parameter to your scripts/programs.

If you mis-type a filename (or directory name) you’ll see the error only executing the command.

cd ~
cd Documanti
-bash: cd: Documanti: No such file or directory
 
cd ~
cd Docu[Tab]
cd Documenti (automatically completed)

 

 

Tagged ,