Skip to content

Commit

Permalink
feat: add chown.md (jaywcjlove#503)
Browse files Browse the repository at this point in the history
* 修改我在contributing.md的镜像链接

* chown备忘清单
  • Loading branch information
undefined-hestudio authored Jan 13, 2024
1 parent f500aae commit 05dae25
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ REF_LABEL=网站首页
- [linzhe.top](https://linzhe.top/)
- [xushanxiang.com](https://xushanxiang.com/ref/)
- [winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)
- [hestudio.org](https://quickref.hestudio.org)
- [quickref.hestudio.net](https://quickref.hestudio.net)
- [surcode.cn](https://ref.surcode.cn)
- [cms.im](https://quickref.cms.im/)
- [nuomiphp.com](https://reference.tool.nuomiphp.com/)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Quick Reference
[Pytorch](./docs/pytorch.md)<!--rehype:style=background: rgb(238 76 44);&class=contributing tag&data-lang=Python&data-info=👆看看还缺点儿什么?-->
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
[Github Copilot](./docs/github-copilot.md)<!--rehype:style=background: rgb(125 45 220);&class=tag contributing&data-lang=AI&data-info=👆看看还缺点儿什么?-->
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
<!--rehype:class=home-card-->

## 编程
Expand Down Expand Up @@ -146,6 +147,7 @@ Quick Reference
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71);&class=tag&data-lang=Rust-->
[Curl](./docs/curl.md)<!--rehype:style=background: rgb(16 185 129);-->
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68);-->
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192);&class=contributing-->
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
Expand Down
1 change: 1 addition & 0 deletions assets/chown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions docs/chown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Chown 备忘清单
===

这份快速参考备忘单提供了改变文件或目录的所有者的简要概述,以及 chown 命令的操作

入门
--------

### 介绍

"chown"是Linux/Unix系统中的一个命令,全称为"change owner",用于改变文件或目录的所有者。这个命令可以更改某个文件或目录的属主(owner),也可以同时更改其属组(group)。

**注意:只有超级用户(root)才有权限改变文件或目录的所有者。**

### 用法

```shell
chown [选项] [所有者][:[组]] 文件或目录名
```
#### 选项
- `-c` : 显示更改的部分的信息
- `-f` : 忽略错误信息
- `-h` :修复符号链接
- `-v` : 显示详细的处理信息
- `-R` : 处理指定目录以及其子目录下的所有文件
- `--help` : 显示辅助说明
- `--version` : 显示版本
示例
--------
### 把 /var/run/httpd.pid 的所有者设为 root
```shell
chown root /var/run/httpd.pid
```
### 将文件 file1.txt 的拥有者设为 username ,群体的使用者设为 groupname
```shell
chown username:groupname file1.txt
```
### 将当前目录以及子目录的所有文件的拥有者设为 username ,群体的使用者设为 groupname
```shell
chown -R username:groupname *
```
### 不修改文件 file1.txt 的拥有者,将文件使用群体改为 groupname
```shell
chown :groupname file1.txt
```

0 comments on commit 05dae25

Please sign in to comment.