ls -l Output Explained: Decode Linux File Permissions, Owners, Sizes, and Timestamps
When you type ls -l in a Linux or Unix terminal, the command returns far more than a simple list of names. It prints a long-format directory listing that reveals permissions, ownership, size, timestamps, and file type information. For newcomers, the output can look like a cryptic wall of letters and numbers. Once you learn how to read each column, however, ls -l becomes one of the most useful diagnostic tools in your daily workflow.
This ls -l output explanation walks through a typical line from left to right. You will see what every permission character means, how the link count works, where the owner and group come from, how size and time are displayed, and what extra symbols such as @, +, and -> tell you about the file. The goal is to make the format predictable rather than mysterious.
The Basic Anatomy of an ls -l Line
A long listing often begins with a line like total 24. That number does not represent the combined byte size of the visible files. Instead, it shows the total number of filesystem blocks allocated to the entries in the directory, typically measured in 1K blocks by default on GNU systems. It gives you a quick sense of how much disk space the directory listing consumes, although sparse files and filesystem overhead can make it differ from a simple sum of apparent file sizes.
Below the total line, each file or directory gets its own row. The standard field order is permissions, hard link count, owner, group, size, modification timestamp, and name. Spaces separate these fields, but filenames may contain spaces, so the name field is best read as everything after the timestamp. Different Unix variants and ls implementations may adjust date formatting or add indicators, but the core structure remains remarkably consistent.
File Type and Permission Columns
The first character of the permissions field identifies the file type. A hyphen means a regular file, d means a directory, l means a symbolic link, c means a character device, b means a block device, s means a socket, and p means a named pipe or FIFO. The next nine characters are split into three groups of three: user permissions, group permissions, and permissions for everyone else. Within each group, r means read, w means write, x means execute, and a hyphen means the permission is not granted.
For example, -rw-r--r-- describes a regular file where the owner can read and write, the group can read, and others can read. A directory such as drwxr-xr-x allows the owner to read, write, and traverse it, while group and other users can read and traverse it but cannot modify its contents. Special permission bits appear when setuid, setgid, or sticky behavior is enabled: a lowercase s replaces the execute bit for setuid or setgid, and a lowercase t replaces the execute bit for the sticky bit. An uppercase S or T means the special bit is set but the corresponding execute bit is not.
Link Count, Owner, and Group
The number after the permissions is the hard link count. For a regular file, it tells you how many directory entries point to the same inode. Create a hard link with ln, and the count increases; remove one link, and it decreases. The file data disappears only when the count reaches zero and no process holds the file open. For directories, the link count is usually at least two because of the directory itself and its . entry, and each immediate subdirectory adds another link through its .. entry on many traditional filesystems.
The next two columns show the owner and group. The owner is usually a username, but if the user account no longer exists, ls may display a numeric UID instead. The group is similarly shown as a group name or a numeric GID when no matching group entry is available. These fields matter because permission checks use them directly: if you are the owner, the owner permission bits apply; otherwise, if you belong to the file group, the group bits apply; otherwise, the other bits apply.
Size, Timestamps, and Filename Details
After the group field comes the size column. For a regular file, this is typically the file length in bytes unless you use options such as -h for human-readable output. For a directory, the size reflects the directory’s own metadata structure, not the total size of all files inside it. For a symbolic link, the size is usually the length of the target path string. For device files, the size column may be replaced by major and minor device numbers, such as 8, 0 for a typical SCSI disk node.
The timestamp field follows size. By default, ls -l shows the modification time, often called mtime. If the file was modified within the last six months, the output usually includes the month, day, and time. Older files usually show the month, day, and year instead. Locale settings and options like --time-style can change that format, while --time=atime or --time=ctime can make ls display access time or inode change time.
Size and Timestamp Fields
The size field can be misleading in specific scenarios. A sparse file may report a large apparent size while occupying far fewer disk blocks, because the filesystem does not allocate storage for empty regions until they are written. Compression, copy-on-write filesystems, and snapshots can also make apparent size differ from actual disk usage. When you need precise allocation details, commands like du, stat, and ls -ls provide more context than a plain long listing.
Timestamps are equally nuanced. Modification time changes when file content changes. Access time updates when a file is read, though many systems mount filesystems with relatime or noatime to reduce writes. Inode change time, or ctime, updates when metadata such as permissions, ownership, or link count changes. Because ls -l shows only one timestamp by default, reading the wrong time as mtime is a common source of confusion when troubleshooting backups, deployments, or file synchronization.
Filename, Symlinks, and Special Indicators
The final and usually most obvious part of the line is the filename. If the entry is a symbolic link, ls displays the link name followed by an arrow and the target path, for example current -> releases/app-2.4. The permissions shown for a symlink often appear as lrwxrwxrwx on Linux, but those permission bits are generally ignored when the link is followed. What matters is the permission on the target file or directory, unless the links are being managed with special mount options or security controls.
Some ls implementations add a single indicator after the permission string. An @ often means extended attributes are present, a + means an access control list is active, and a . may indicate an SELinux security context. These markers are easy to overlook, yet they can explain why a file behaves differently from what its basic rwx bits suggest. Colored output, trailing slashes, and classification characters from -F are also useful, but remember that colors and indicators are presentation features controlled by ls options and environment variables, not part of the underlying file metadata.
The next time an ls -l listing appears on your screen, try reading it one column at a time instead of scanning the whole row at once. Run it against a directory you know well, compare the permissions, owner, group, size, and timestamp with what you expect, and use options like -h, --time-style, and stat when you need more detail. That small habit turns a dense terminal output into a clear snapshot of your filesystem, helping you spot permission problems, unexpected ownership, or suspicious file changes before they become bigger issues.