How to get permission number by string : -rw-r--r-- What do you mean by “set the same”? Do you already have a file with -rw-r--r-- permission and want to set another file with the same permissions? Then see if your chmod supports --reference: “--reference=RFILE use RFILE's mode instead of MODE values” – man chmod
某文件的权限为d-rw-r-r--,用数值形式表示改权限,为什么是644? - 知乎 谢邀!下图是我多年前自学 Linux 时留下的一张表,主要说明Linux 文件属性 和 权限。字母rwx分别代表读取、写入、执行三种权限,而又被赋予不同的数字表达(4、2、1),三个字母为一组代表一类用户权限,首个字母表示文件的属性,是普通文件(-)还是文件夹(d),然后从左到右分别是文件所有