简体   繁体   English

查看Linux文件权限号

[英]Viewing Linux File Permission Number

So I know that ls -l directory will get you the file permssion on a directory...and I know that chmod number directory will change the file permissions on a directory. 所以我知道ls -l目录会为您提供目录中的文件权限...而且我知道chmod number目录会更改目录中的文件权限。

But how can I view the number translation of a file permission? 但是,如何查看文件权限的数字转换? I'd like to make an exact copy of a file permission, without making a mistake (I figured it's easy to mess up a number translation of a file permission) 我想准确地复制文件权限,而不会出错(我认为很容易弄乱文件权限的数字翻译)

Thanks 谢谢

(PS I need the number for drwxr-xr-x) (PS我需要drwxr-xr-x的号码)

Its just a bit field so its 421 421 421 add up the rwx rwx rwx so in your case 它只是一个位字段,所以它的421 421 421将rwx rwx rwx加起来,所以在您的情况下

   421
   rwx = 7
   r x = 5
   r x = 5

   755

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM