Linux命令(三)之 文件查看、移动、压缩、权限设置

 Linux文件系统介绍:

一、 查看文件

1、ls

2、cat

3、less and more

4、head and tail

二、文件基本操作

1、创建

2、删除

3、移动

4、复制

三、文件解压缩

1、zip

2、ungip

3、tar

tar xvf Python-3.6.6.tar.xz

# x:解压 v:显示所有过程 f:使用档案名字,切记,这个参数是最后一个参数,后面只能接档案名

四、文件进阶操作

1、查找文件

2、软连接

3、更改文件权限:

# 1 chmod 语法

"给谁设置文件权限(who), 对文件权限做什么样的改变(what), 设置哪种的文件权限(which)"


## who: u(user:文件所有者),g(group:用户所在组),o(others:其他组用户),a(all:全部用户)

## what: + (添加权限), - (删除权限), = (重新赋予权限)

## which: r(读权限), w(写权限), x(执行权限)



# 2 示例
chmod u=rw,og=r new_file.txt

chmod a+x new_script.sh # 等价 chmod +x new_script.sh

chmod o-r *.page

### If we had wanted to include files in subdirectories, we could have used the -R (recursive) option.
chmod -R o-r *.page 



# 3 数字表征不同权限
0: (000) No permission.
1: (001) Execute permission.
2: (010) Write permission.
3: (011) Write and execute permissions.
4: (100) Read permission.
5: (101) Read and execute permissions.
6: (110) Read and write permissions.
7: (111) Read, write, and execute permissions.


chmod 664 *.page







参考链接:

How to Use the chmod Command on Linux (howtogeek.com)

Linux:文件系统_不怕猫的耗子A的博客-CSDN博客_linux文件系统

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值