9.2 File Name Completion

   

9.2 File Name Completion

File name completion is used when you are typing commands with long file names . Using this feature of the shell, you type in a few starting characters of the name of a file and then press the graphics/esc.gif key twice, and the shell completes the name of the file. Consider a directory that contains three files, and you want to see the contents of a file beta .

 $  ls  alpha-334  alpha-434  beta $  cat b Esc Esc  $  cat beta  

As soon as you press the graphics/esc.gif key twice, the shell completes the file name as shown in the last line.

If there is more than one file that starts with the same characters you have typed, the shell completes the file name to the extent that all files have the same characters. After that you can press the graphics/esc.gif and graphics/equal.gif keys to list the available choices and then complete the file name by typing additional characters. Please see the next example where two files start with the letter a . By pressing the graphics/esc.gif key twice, the shell completes the file name up to alpha- . After that you can press the graphics/escequal.gif keys to see the choices, and then complete the command using the usual command line editing method or by typing additional characters and again pressing the graphics/esc.gif key twice.

 $  ls  alpha334  alpha-434  beta $  cat a Esc Esc  $  cat alpha- Esc  =  1) alpha-334 2) alpha-434 $ 

After displaying the matching files, you can type a few more characters on the command line to distinguish files and again press the graphics/esc.gif key twice to complete the file name.

The file name completion mechanism may be very useful when typing long commands with less keystrokes and without any error.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net