Hdi2u S11

From wiki
Revision as of 22:32, 19 April 2017 by Rf (talk | contribs) (Created page with "= Tab completion = * Fear of the command line often means, fear of typing too much. Everybody fears this, so there are tools. * Tab completion is probably the most important...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tab completion

  • Fear of the command line often means, fear of typing too much. Everybody fears this, so there are tools.
  • Tab completion is probably the most important tool, and relies on your pressing the TAB key
  • It tries to complete the filename or program name you have started typing, saving you typing time and reducing spelling errors.
cd kir
  • followed by TAB. If there is only one directory with a name starting with the letters "kir", the rest of the name will be completed for you.
  • if there are several options, you need to supply more "hint-letters" and press TAB multiple times.

Exercises

  • Type ls testseq and use tab completion.
  • This will show you a list of files that start with testseq.
  • You now have the option of completing the filename yourself, or "tabbing" through the filenames available.
  • It limits itself to files in your current directory.
  • What happens if you type TAB immediately after ls?
  • How can you find out all commands available on the system?

Answer

  • The first word of a command line is usually a command, so TAB looks for commands, not files.
  • By giving no hints at all to TAB, it will look for all possible commands.