ls is one of the most basic Unix commands. It enables you to list the contents of a directory. Tip
To list the contents of your home directoryType ls and press . A list of the contents of your home directory appears (Figure 4). Figure 4. A simple directory listing using the ls command.To list the contents of a subdirectoryType ls followed by the subdirectory name (for example, ls Library) and press . A list of the contents of the subdirectory you typed appears (Figure 5). Figure 5. A listing for the library subdirectory.To view a long directory listingType ls -l and press . A list of the contents of your home directory, including permissions, owner, size, and modification date information, appears (Figure 6). Figure 6. The long version of a directory listing includes permission, owner, file size, and modification date information.Tip
To include invisible items in a directory listingType ls -a and press . A list of the contents of your home directory, including invisible items, appears (Figure 7). Figure 7. A directory listing that includes invisible subdirectories. |