如何查看特定目录的权限? [英] How to check permissions of a specific directory?

查看:140
本文介绍了如何查看特定目录的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道使用 ls -l目录/目录/文件名 会告诉我文件的权限。如何在目录上执行同样的操作?

I know that using ls -l "directory/directory/filename" tells me the permissions of a file. How do I do the same on a directory?

我显然可以在更高目录中的目录上使用 ls -l <​​/ code>层次结构,然后滚动直到找到为止,但这真是太痛苦了。如果我在实际目录上使用 ls -l <​​/ code>,它将提供其中的文件的权限/信息,而不是实际目录的文件。

I could obviously use ls -l on the directory higher in the hierarchy and then just scroll till I find it but it's such a pain. If I use ls -l on the actual directory, it gives the permissions/information of the files inside of it, and not of the actual directory.

我在Mac OS X 10.5和Linux(Ubuntu Gutsy Gibbon)的终端上都尝试过,结果是一样的。我应该使用某种标志吗?

I tried this in the terminal of both Mac OS X 10.5 and Linux (Ubuntu Gutsy Gibbon), and it's the same result. Is there some sort of flag I should be using?

推荐答案

这是简短的答案:

$ ls -ld directory

它的作用是:

-d, --directory
    list directory entries instead of contents, and do not dereference symbolic links

您可能对 手册页 。这就是这里所有人都能从中得到很好答案的地方。

You might be interested in manpages. That's where all people in here get their nice answers from.

请参考 在线手册页

这篇关于如何查看特定目录的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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