Supported by: ACS
You can view lists of all the files in any directory.
The ls command lists your files alphabetically. Enter the command:
ls
and the files and subdirectories in the current, or working, directory will be listed in columns.
There is an on line manual page. To read it, enter the command man ls at a UNIX prompt. For general information about handling files, please refer to Memo RPI.113, Using UNIX: The Rensselaer Computing System (RCS).
There are several ways you can use the ls command to obtain different
information about your files. For example, to see all your files, including
filenames that begin with a dot (.), such as .login_profile, enter
ls -Ra
To see the sizes of the files in blocks, enter
ls -s
Filenames that begin with a dot designate files that you don't need to work with very often. For example, .login is a file that contains settings that are applied every time you log in. You might change this file once in a while, but it isn't something you need to change often.
UNIX uses * as a wildcard character. You can use a wildcard with many types of commands to affect a group of files that share common characters in their names. For example, with ls you could list all the files that start with s by entering this command:
ls s*
As another example, you could list all the files that end in .temp by entering this:
ls *.temp
If you use ls and no files are listed, there are no regular files in the directory. If you use ls -a and only . and .. are listed, there are no dot-files in the directory. The directory is empty.
Return to ACS Consulting home page.
Return to the General System page.
Return to ACS home page.
Please send comments and suggestions to
consult@rpi.edu