Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux命令学习 #49

Open
huangchucai opened this issue Sep 11, 2018 · 0 comments
Open

Linux命令学习 #49

huangchucai opened this issue Sep 11, 2018 · 0 comments

Comments

@huangchucai
Copy link
Owner

Linus高级命令

1. 查看端口占用情况

netstat 

2. 修改文件的权限

Linux 把文件或目录权限的控制分别以读取、写入、执行三种情况区分(权限设置)

r : 读取权限, 数字代号为“4”
w : 写入权限, 数字代号为“2”
x : 执行或切换权限,数字代表为“1”
- : 不具任何权限,数字代表为“0”
S : 特殊功能说明:变更文件或目录的权限。

Liunx把用户也分为三种(权限范围)

u User: 即文件或目录的拥有者
g Group: 即文件或目录的所属群组
o Other: 除了文件或目录拥有者或所属群组之外,其他用户皆属于这个范围
a All: 即全部的用户,包含拥有者,所属群组以及其他用户
image

语法

chmod (选项) (参数)
// 用法
chmod <权限范围>+<权限设置> 文件 开启权限范围的文件或目录的该选项权限设置
chmod <权限范围>-<权限设置> 文件 关闭权限范围的文件或目录的该选项权限设置

// 执行
chmod u+x test.lua
-rwxr-xr-- 1 root root 169 9月   5 11:28 download_geoip.sh*
-rw-r--r-- 1 root root 360 9月   5 11:30 md5url.sh
-rwx------ 1 root root  34 9月  11 19:59 test.lua*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant