终端命令:ls -l显示什么? [英] what does terminal command: ls -l show?

查看:244
本文介绍了终端命令:ls -l显示什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道它输出的是"long"版本,但是每个部分的含义是什么?

I know that it outputs the "long" version but what do each of the sections mean?

在我的Mac上,当我输入

On my mac, when I type in

ls -l /Users 

我知道

total 0
drwxr-xr-x+ 33 MaxHarris  staff  1122 Jul  1 14:06 MaxHarris
drwxrwxrwt   8 root       wheel   272 May 20 13:26 Shared
drwxr-xr-x+ 14 admin      staff   476 May 17 11:25 admin
drwxr-xr-x+ 44 hugger     staff  1496 Mar 17 21:13 hugger

我知道第一行是权限,尽管我不知道命令是什么.如果这也可以解释的话,那就太好了.那它后面的数字是多少?

I know that the first line it the permissions, although I don't know what the order is. It would be great if that could be explained too. Then whats the number after it?

基本上,这些东西中的每一个是什么意思?为什么有时用户名两次写两次而其他时候不匹配?

Basically, what do each one of these things mean? Why are the usernames written twice sometimes and don't match other times?

推荐答案

选项'-l'告诉命令使用长列表格式.它返回对应于:

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

  • 权限
  • 硬链接数
  • 文件所有者
  • 文件组
  • 文件大小
  • 修改时间
  • 文件名

权限"列中的第一个字母显示文件的类型. "d"表示目录,-"表示普通文件(有其他字符,但这些是基本字符). 接下来的9个字符分为3组,每组一个权限.组中的每个字母对应于读取,写入和执行权限,每个组分别对应于文件的所有者,文件的组,然后对应于其他所有人.

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.

  • [文件类型] [所有者权限] [组权限] [每个人权限]

字符可以是四个选项之一:

The characters can be one of four options:

  • r =读取权限
  • w =写入权限
  • x =执行权限
  • - =没有权限
  • r = read permission
  • w = write permission
  • x = execute permission
  • - = no permission

最后,最后的"+"表示某些扩展权限.

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

这篇关于终端命令:ls -l显示什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆