Unix recognizes the following types of files:
Use ls -F (fancy listing) or ls -l (long listing):
(~/tmp) 119% ls -F answers/ dump_grades* problem_set_2.txt current_assignment.txt@ problem_set_1.txt problems/ (~/tmp) 120% ls -l total 8 drwxrwxr-x 2 lstein 1024 Aug 29 22:58 answers/ lrwxrwxrwx 1 lstein 17 Aug 29 23:00 current_assignment.txt -> problem_set_2.txt -rwxr-xr-x 1 lstein 359 Aug 29 23:05 dump_grades* -rw-r--r-- 1 lstein 1381 Aug 29 22:59 problem_set_1.txt -rw-r--r-- 1 lstein 2323 Aug 29 22:59 problem_set_2.txt drwxrwxr-x 2 lstein 1024 Aug 29 22:58 problems/
With -F, regular files are listed normally, directories get a "/" appended to the end, symbolic links get an "@" appended to the end, and executable files get a "*".
The -l option creates a long listing which gives the file's owner, modification date, name, and permissions (the bizarre-looking first column). Symbolic links show a little arrow followed by the file or directory the link points to.
The file permission display should be interpreted this way:
flags owner group world | --- --- --- d rwx rwx r-x 2 lstein 1024 Aug 29 22:58 problems/
For files, read, write, and execute permission do what you think they might do. For directories, read permission lets you list the contents of the directory, write permission lets you create or delete files in the directory, while execute permission lets you cd to the directory.
See the manual page on chmod for more information about file permissions.
|
| Contents |
Next |