How to interpret ls -l output?

The output of the ls -l command provides detailed information about files and directories. Here’s how to interpret each part of the output:

  1. File Type and Permissions: The first column shows the file type and permissions.

    • The first character indicates the type: - for a regular file, d for a directory, l for a symbolic link, etc.
    • The next nine characters represent permissions: three for the owner, three for the group, and three for others (e.g., rwxr-xr--).
  2. Number of Links: The second column shows the number of hard links to the file or directory.

  3. Owner: The third column displays the username of the file's owner.

  4. Group: The fourth column shows the group name associated with the file.

  5. File Size: The fifth column indicates the size of the file in bytes.

  6. Modification Date and Time: The sixth column shows the last modification date and time of the file.

  7. File Name: The final column displays the name of the file or directory.

Example Output:

-rw-r--r-- 1 user group  2048 Mar  1 12:34 example.txt
  • -rw-r--r--: Regular file with read/write permissions for the owner, and read permissions for the group and others.
  • 1: One hard link.
  • user: Owner of the file.
  • group: Group associated with the file.
  • 2048: Size of the file in bytes.
  • Mar 1 12:34: Last modified on March 1 at 12:34 PM.
  • example.txt: Name of the file.

This format helps you understand the properties and permissions of files and directories in a directory listing.

0 Comments

no data
Be the first to share your comment!