bash:ls:ls_output_fields_definitions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash:ls:ls_output_fields_definitions [2020/04/29 11:39] – peter | bash:ls:ls_output_fields_definitions [2021/01/26 16:01] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== BASH - ls - ls output fields definitions ====== | ||
- | |||
- | The output of the **ls** command depends on the version of " | ||
- | |||
- | <code bash> | ||
- | ls -al | ||
- | </ | ||
- | |||
- | returns: | ||
- | |||
- | <code bash> | ||
- | -rwxrw-r-- | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | <code bash> | ||
- | -rwxrw-r-- | ||
- | ? | ||
- | ^ ^ ^ ^ ^ ^ ^ ^ ^ \-- Date Time stamp. | ||
- | | | | | | | | | \--- File Size. | ||
- | | | | | | | | \-------- Group Name (for example, Users, Administrators, | ||
- | | | | | | | \--------------- Owner Name. | ||
- | | | | | | \---------------------- Link count (Usually refers to number of hard links; but can vary.) | ||
- | | | | | \--------------------------- Alternative Access (blank means none defined, anything else varies) | ||
- | | \--\--\----------------------------- File Mode Permissions. | ||
- | \------------------------------------- File Type flag. | ||
- | </ | ||
- | |||
- | * **File Type flag**: | ||
- | * There are many others, but less commonly seen, file types for various filesystems. | ||
- | * **File Mode Permissions**: | ||
- | * First set is permissions for the " | ||
- | * Second set is permissions for the " | ||
- | * Third set is permissions for " | ||
- | * **Link count**: | ||
- | * **Alternative Access flag**: | ||
- | * **File Size**: | ||
- | * **Date Time stamp**: | ||
- | |||
- | |||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | Also note that among the more common platforms, Microsoft platforms tend not to translate very well to **ls** output, so you may see odd behavior, flags, or other unusual info in the output, depending on how your version of " | ||
- | </ | ||
- | |||
- | |||
- | |||
- | ---- | ||
- | |||
- | ===== File Types flag ===== | ||
- | |||
- | On most systems, the first field is also used to indicate the presence of extra attributes like ACLs, security attributes or other extended attributes. | ||
- | |||
- | |-|Regular file| | ||
- | |b|Block special file| | ||
- | |c|Character special file| | ||
- | |C|High performance (" | ||
- | |d|Directory| | ||
- | |D|Door (Solaris 2.5 and up)| | ||
- | |l|Symbolic link| | ||
- | |M|Off-line (" | ||
- | |n|Network special file (HP-UX)| | ||
- | |p|FIFO (named pipe)| | ||
- | |P|Port (Solaris 10 and up)| | ||
- | |s|Socket| | ||
- | |?|Some other file type| | ||
- | |||
- | ---- | ||
- | |||
- | ===== File Mode Permissions ===== | ||
- | |||
- | Each of the three characters represent the read, write, and execute permissions: | ||
- | |||
- | Usually in the form: | ||
- | |||
- | < | ||
- | rwx rwx rwx | ||
- | </ | ||
- | |||
- | * First set of rwx are permissions for the owner of the file. | ||
- | * Second set of rwx are permissions for the group that the owner belongs to. Everyone in the same group will get these permissions to the file. | ||
- | * Third set of rwx are permissions for others. | ||
- | |||
- | |r|Reading is permitted.| | ||
- | |w|Writing is permitted.| | ||
- | |x|Execution is permitted. | ||
- | |-|The specific permission is not allowed.| | ||
- | |||
- | but **ls** can combine multiple bits into the third character of each set of permissions as follows: | ||
- | |||
- | |s|If the set-user-ID or set-group-ID bit and the corresponding executable bit are both set.| | ||
- | |S|If the set-user-ID or set-group-ID bit is set but the corresponding executable bit is not set.| | ||
- | |t|If the restricted deletion flag or sticky bit, and the other-executable bit, are both set. The restricted deletion flag is another name for the sticky bit.| | ||
- | |T|If the restricted deletion flag or sticky bit is set but the other-executable bit is not set.| | ||
- | |x|If the executable bit is set and none of the above apply.| | ||
- | |||
- | <WRAP info> | ||
- | **NOTE:** Sometimes you may encounter an **s** or **S** for setuid and/or setgid programs, or other less common characters. | ||
- | |||
- | See your **ls** documentation for the mode characters it will show. | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | ---- | ||
- | |||
- | ===== Alternative Access Types ===== | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | ===== Links ===== | ||
- | |||
- | Some platforms have an odd notion of what constitutes a **link**. | ||
- | |||
- | These usually include hard links and symbolic links, as well as directory entries (which is why directories often have high link counts – its parent has one link, the directory has a link to itself in the . entry, and each of its sub-directories has a link back via .. | ||
- | |||
- | ---- | ||
- | |||
- | ===== Date Time stamp ===== | ||
- | |||
- | The **Date Time stamp** is usually the date/time the file was last modified, not the time the file was created. | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | The **ctime** field does NOT mean " | ||
- | |||
- | The **mtime** (last [M]odified) and atime (last [A]ccesed/ | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== References ===== | ||
- | |||
- | https:// | ||
- | |||
- | https:// | ||
- | |||
bash/ls/ls_output_fields_definitions.1588160350.txt.gz · Last modified: 2020/07/15 09:30 (external edit)