Filename Completion

Introduction

Filename completion lets you type part of a filename and then press the TAB key; if what you have typed so far uniquely specifies a filename, tcsh will complete it for you.

Notes

  • If you are in a directory with two files, one named mail and one named oldmail, you can remove oldmail by typing:
    
    % rm oTAB
    
    
  • The TAB part of that is just the Tab key.
  • tcsh will fill in the whole name of the file on the command line for you, leaving you with:
    
    % rm oldmail
    
    
  • But you didn't have to type the ldmail!
  • If what you typed so far when you press the Tab key isn't unique, tcsh will fill in as much as it can and then send a bell which will make your terminal beep to indicate it didn't finish the filename.
  • For example, if you are in a directory with files mail.1 and mail.2 and you type:
    
    % rm mTAB
    
    
    ... then tcsh will add ail. and beep.
  • If you want to see what files match what you have typed so far, you can press control-D and tcsh will show you all the files that match as much as you have typed:
    
    % ls
    mail.1  mail.2
    % rm mail.^D
    mail.1  mail.2
    % rm mail.