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

[ Up ]

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
    -l      Lists in long format.  Gives all sorts
            of information.
    -R      Recursively lists subdirectories
    -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.

Site Statistics

t a y l o r@l i n u x b o x.c o m

© 1993-1998 Christopher C. Taylor