what does terminal command: ls -l show?

徘徊边缘 提交于 2019-11-30 04:33:00

The option '-l' tells the command to use a long list format. It gives back several columns wich correspond to:

  • Permissions
  • Number of hardlinks
  • File owner
  • File group
  • File size
  • Modification time
  • Filename

The first letter in the permissions column show the file's type. A 'd' means a directory and a '-' means a normal file (there are other characters, but those are the basic ones). The next nine characters are divided into 3 groups, each one a permission. Each letter in a group correspond to the read, write and execute permission, and each group correspond to the owner of the file, the group of the file and then for everyone else.

  • [ File type ][ Owner permissions ][ Group permissions ][ Everyone permissions ]

The characters can be one of four options:

  • r = read permission
  • w = write permission
  • x = execute permission
  • - = no permission

Finally, the "+" at the end means some extended permissions.

If you type the command

$ man ls

You’ll get the documentation for ls, which says in part:

The Long Format
If the -l option is given, the following information is displayed for each file: file mode, number of links, owner name, group name, number of bytes in the file, abbreviated month, day-of-month file was last modified, hour file last modified, minute file last modified, and the pathname. In addition, for each directory whose contents are displayed, the total number of 512-byte blocks used by the files in the directory is displayed on a line by itself, immediately before the information for the files in the directory. If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information (such as an access control list), the permissions field printed by the -l option is followed by a '+' character.

The man command is short for “manual”, and the articles it shows are called “man pages”; try running man manpages to learn even more about them.

The following information is provided:

  • permissions
  • number of linked hardlinks
  • owner of the file
  • to which group this file belongs to
  • size
  • modification/creation date and time
  • file/directory name
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!