Linux Command: chmod, cat
来源:互联网 发布:unity3d getaxis 编辑:程序博客网 时间:2024/05/04 11:34
chmod
该命令用来修改文件权限。明白文件权限和用户组的两个概念。
用户组:
- u user 文件所有者
- g group 文件所有者所在组
- o others 所有其他用户
- a all 所有用户,等价于ugo
权限:
- r read 读
- w write 写
- x execute 执行
然后,该命令有两种使用模式:符号模式和数字模式。
符号模式:chmod o+rw myfile.txt
参数o+rw中,o指定用户组,可以为u, g, o, a;+表示增加权限,可为-, =;rw指明权限,可以为r, w, x, X, s, t。
数字模式:chmod 664 myfile
三个数字分别为三个用户组指明权限:u, g, o。
每一个数字为一个用户组指明3个权限,6的2进制表示为110,对应的权限rw-。也就是说,3位的二进制数分别表示3个权限rwx,若对应的二进制位上是1,则有该权限,若为0,则无该权限。
cat
该命令用来显示、创建、拼接文本,还可制作镜像。
cat > myfile 创建文本
cat myfile 显示整个文本
可有如下参数:
- -n --number 在每行前加行号,并输出内容,从1开始;
- -b --number-nonblank 与-n类似,只是对空白行不编号;
- -s --squeeze-blank 对连续的两行或者两行以上的空白行,用一个空白行代替;
- -v --show-nonprinting 显示不可打印的字符。
合并文本:
cat file1 file2 > file3 等价于file3 = file1 + file2
cat file1 >> file2 等价于file3 += file1
制作镜像
cat IMG_FILE > /dev/fd0
- Linux Command: chmod, cat
- LINUX Command: chmod
- LINUX Command: chown & chmod
- Linux command:chmod
- Linux: cat command
- linux 文件系统命令 cat cd chmod
- Linux - one command per day--chmod
- Linux-- one command per day--cat
- HowTo: Use cat Command In Linux / UNIX
- linux_13 Basic Cat Command Examples in Linux
- command: cat
- Linux Commands for Beginners-- Changing Permissions --chmod command
- bzip2recover cat chattr chgrp chmod
- Linux常用命令-3---file、tar、cat、chgrp、chown、chmod、vi、time
- Linux chmod
- Linux-chmod
- linux chmod
- linux chmod
- SharePoint SSS(Security Store Service)服务-PowerShell
- NS2中内容分发系统(CDN)仿真
- 编译apache时出错
- 正确使用c语言中的头文件
- 图片保存在相册中-相同图片(地址)避免重复保存
- Linux Command: chmod, cat
- 【转】Python中类的特殊方法
- Windows 核心编程之10 IO完成端口
- 第七章 例7.6
- hibernate生成table
- SQl 2008/2005 数据库镜像
- 大数相乘算法
- PHP正则表达式的快速学习方法
- 0705学习笔记函数的练习