->Title Page
->Intro
->Unix
-->Overview
-->File Structure
-->Online Manual
-->Basic Commands
--->Logging In
--->Password
--->Getting Out
->Listing files
--->Catenate
--->Paging
--->Copying
--->Removing
--->Renaming
--->Directory trees
--->Make/Remove Directories
-->Additional Commands
-->Login files
-->Special characters
-->Miscellaneous Tips
-->Things to try
->Vi editor
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Unix ---> Listing files

The names of files and subdirectories can be displayed with the ls (list) command. Typing ls lists the files and subdirectories located in the working directory that don't begin with a ".". To see all the names, use the all flag, i.e. ls -a.

Other interesting flags for the ls command are:


    -F      Marks directories with a trailing slash
            and executable files with a trailing
            asterisk.
    -l      Lists in long format.  Gives all sorts
            of information.
    -R      Recursively lists subdirectories
            encountered.
    -s      Gives the size of each file.
    -t      Sorts by time modified instead of by name.
It is possible to limit the scope of the files and subdirectories by using wildcard characters. For example, I would type


    ls q*
if I wanted to list all the files and subdirectories that began with a q.

Note that the ls command lists files in the working directory only, unless you include the pathname to another directory whose filenames you want to list.

Please notify owners of webpages with outdated links to these pages

Find this site useful? Want to give something back?

© 1993-2001 Christopher C. Taylor