Listing Filenames and Attributes in UNIX

The ls command is the UNIX way to list file directories. MPE uses the :Listf and :Listfile commands.

% ls [-adlFR] [ pathnames ]

There are many more options. Try also the l, ll, lsf, lsr, and lsx commands.

% ls -F {adds "/" for directory, "*" for exec, "@" for link}
% ls -ld a* b* {long format, directory status, starting with "a" or "b"}
% ls -lR test/ {long list, recursively show sub-directories of "text"}
% ls -a {shows "hidden" dot files as well}

Hidden Files

Filenames in UNIX can contain almost any character and start with almost any character. However, filenames starting with a "." (dot, period) are often called hidden files because they don't show up in a regular ls command and you don't get rid of them with a rm * command. It is common for UNIX tools to create "dot" files for temporary files and to maintain control and history information. Users are also expected to create them as configuration files.



.profile is your Bourne and Korn shell configuration file (the Korn shell also executes
the shell script in the ENV variable before reading .profile).
.login is your C shell startup file.
.logout is your C shell termination file.
.cshrc is your C shell configuration file.
.history is your shell command history file.
.mailrc is your mail configuration file.
.forward forwards your mail to another e-mail address. When you leave home, do
echo bsmith@hotel.com >.forward. When you return, do rm .forward.

Use ls -a to see hidden files and rm .??* to delete them. The rm -r command is a sure-fire way to get rid of invisible files and files with non-printing characters in the name and all subdirectories.