Listing Files

The Is (list) command lists files in the current directory. The command Is has a very large number of options, but what you really need to know is that Is -l gives a "long" listing showing the file sizes and permissions, and that the -a option shows even "hidden" files — those with a dot at the start of their names. The shell expands the * character to mean "any string of characters not starting with '.'.'' (See the discussion of wildcards in the "Advanced Shell Features'' section earlier in this chapter for more information about how and why this works.)

Therefore, *.doc is interpreted as any filename ending with .doc that does not start with a dot and a* means "any filename starting with the letter a." For example:

■ Is -la — Gives a long listing of all files in the current directory including "hidden" files with names starting with a dot

■ Is a* — Lists all files in the current directory whose names start with a

■ ls-l*.doc — Gives a long listing of all files in the current directory whose names end with .doc

Was this article helpful?

0 0

Post a comment