Display information about all the files in a directory by using the ls command.
$ ls -la |
-l |
Displays the long format. |
-a |
Displays all files, including hidden files that begin with a dot (.). |
Each line in the display has the following information about a file:
Type of file
A file can be one of seven types. The table below lists the possible file types.
Table 17-4 File Types
Symbol |
Type |
---|---|
- |
Text or program |
d |
Directory |
b |
Block special file |
c |
Character special file |
p |
Named pipe (FIFO) |
l |
Symbolic link |
s |
Socket |
Permissions; see Table 17-1 and Table 17-2 for descriptions
Number of hard links
Owner of the file
Group of the file
Size of the file, in bytes
Date the file was created or last date it was changed
Name of the file
The following example displays the partial list of the files in the /sbin directory.
$ cd /sbin $ ls -la total 13456 drwxr-xr-x 2 root sys 512 Sep 1 14:11 . drwxr-xr-x 29 root root 1024 Sep 1 15:40 .. -r-xr-xr-x 1 root bin 218188 Aug 18 15:17 autopush lrwxrwxrwx 1 root root 21 Sep 1 14:11 bpgetfile -> ... -r-xr-xr-x 1 root bin 505556 Aug 20 13:24 dhcpagent -r-xr-xr-x 1 root bin 456064 Aug 20 13:25 dhcpinfo -r-xr-xr-x 1 root bin 272360 Aug 18 15:19 fdisk -r-xr-xr-x 1 root bin 824728 Aug 20 13:29 hostconfig -r-xr-xr-x 1 root bin 603528 Aug 20 13:21 ifconfig -r-xr-xr-x 1 root sys 556008 Aug 20 13:21 init -r-xr-xr-x 2 root root 274020 Aug 18 15:28 jsh -r-xr-xr-x 1 root bin 238736 Aug 21 19:46 mount -r-xr-xr-x 1 root sys 7696 Aug 18 15:20 mountall . . . |