xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

linux & chmod & 777 & 755

https://github.com/xgqfrms-GitHub/Node-CLI-Tools/blob/master/bash-shell-chmod.md

chmod +x

chmod 777

chmod 755

https://zzk.cnblogs.com/my/s/blogpost-p?Keywords=chmod


#!/bin/sh

# echo "^-v-^ JSON DB is running in development env!" && npm run db

# echo "^-v-^ JSON DB is running in development env!" && nodemon -w ./server.js localhost 8888

JSONDB="nodemon -w ./server.js localhost 8888"

${JSONDB} &
# chmod +x db.sh
# sudo ./db.sh
# nodemon -w ./server.js localhost 8888

# /bin/sh db.sh

# ps -ef | grep node
# sudo kill -9 <PID>

$ chmod +x

-R

递归 recursive

$ chmod -R 777 your_directory_name

not a shell

ok

image

755

N   Description                      ls   binary    
0   No permissions at all            ---  000
1   Only execute                     --x  001
2   Only write                       -w-  010
3   Write and execute                -wx  011
4   Only read                        r--  100
5   Read and execute                 r-x  101
6   Read and write                   rw-  110
7   Read, write, and execute         rwx  111

Linux 用户组的权限,

分组, rwx / r-x / r-- / -w- /--x / ---

drwx------ 700权限(d 目录 ,r=4, w=2, x=1)

r === read, 4
w === write, 2
x === exec/execute, 1

drwx------ === 777

d === directory/folder
rwx ===7;// 4 + 2 + 1
rwx === 5;// 4 + 0 + 1
rwx === 5// 4 + 0 + 1

drwxr-xr-x === 755

d === directory/folder
rwx ===7;// 4 + 2 + 1
r-x === 5;// 4 + 0 + 1
r-x === 5// 4 + 0 + 1

在linux下使用命令 ll 或ls -l 的时候会看到这些字眼,这些字符表示为不同用户组的权限:
r:read就是读权限 --数字4表示
w:write就是写权限 --数字2表示
x:excute就是执行权限 --数字1表示

读、写、运行三项权限可以用数字表示,就是r=4,w=2,x=1。所以,-rw-r--r--用数字表示成644。

这里总共会有10个“-”,第一个表示文件类型,如该文件是文件(-表示),文件夹(d表示), 连接文件(l表示);
后面9个按照三个一组分,如:
-rwxrwx--- 770权限表示此文件(文件夹)的拥有着和同组用户有读写及执行权限,其他用户组没任何权限

就是前面三个表示所有者权限,中间三个表示同组用户权限,最后一组表示其他用户权限

以上的其他用户,不包括root这个super user。

Linux下的文件类型如下:

-普通文件
d 目录
l 链接文件
b 块设备
c 字符设备

refs

https://stackoverflow.com/questions/8328481/chmod-777-to-a-folder-and-all-contents

https://stackoverflow.com/questions/3740152/how-to-change-permissions-for-a-folder-and-its-subfolders-files-in-one-step

# To change all the directories to 755 (drwxr-xr-x):

# d === directory

$ find /opt/lampp/htdocs -type d -exec chmod 755 {} ;



# To change all the files to 644 (-rw-r--r--):

# f === file

$ find /opt/lampp/htdocs -type f -exec chmod 644 {} ;


Linux 用户组的权限

drwx------ 700权限(d 目录 ,r=4, w=2, x=1)

r === read, 4
w === write, 2
x === exec/execute, 1

drwx------ === 700

d === directory/folder
rwx ===7;// 4 + 2 + 1
--- === 0;// 0 + 0 + 0
--- === 0// 0 + 0 + 0

http://www.imooc.com/article/4777



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


原文地址:https://www.cnblogs.com/xgqfrms/p/9546961.html