CH02_shell及常用命令.ppt

  1. 1、本文档共58页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CH02_shell及常用命令

* 常用选项 f 使用档案文件或设备,这个选项通常是必选的。 M 创建多卷的档案文件,以便在几个磁盘中存放。 v 详细报告tar处理的文件信息。如无此选项,tar不报告文件信息。 z 用gzip来压缩/解压缩文件 tar命令的辅助选项的常用选项 文件打包tar(续) * 文件打包tar(续) tar -cvf emailsdir.tar emails (archive an entire directory tree (emails), produce emailsdir.tar. No compression here) tar -xvf emailsdir.tar (extract to restore directory tree (emails)) * 文件权限 $ ls -l total 161 -rwxr-xr-x 1 mingming group1 17878 a.out -rw-r--r-- 1 mingming group1 5053 test drw-r-xr-x 1 mingming group1 512 dsa ... - rwx rwx rwx a file user (owner) group other (world) file u g o * 文件权限 (续) - rw- r-- r-- user (you) group other (world) file a file you create r - read w - write x - execute A file does not have executable permission by default, not even for the owner * 目录权限 d rwx r-x r-x user (you) group other (world) directory a directory you create * 目录权限 (续) 目录权限 读 – 可以列出存储在该目录下的文件 写 – 允许从目录中删除或添加新的文件 执行 – 允许在目录中查找,并能用cd命令将工作目录改到该目录: cat /u/mingming/emails/e1.txt * chmod: 改变文件或目录的存取权限 chmod u+x file1.txt x permission for owner chmod ugo+x file1.txt x permission for all chmod a+x file1.txt x permission for all chmod a-x file1.txt remove x permission for all chmod a-rwx file1.txt remove all permissions for all (文件的权限只能被创建者或超级用户修改) * chmod命令 (续) chmod a+r, u+w file1.txt chmod a=r file1.txt chmod u=rwx file1.txt * chmod命令 (续) 用8进制数表示 读权限 - 4 写权限 - 2 可执行权限 - 1 chmod 666 file1.txt is the same as chmod a=rw file1.txt chmod 644 file1.txt (set r for all and w for user only) chmod 777 file1.txt chmod 000 file1.txt * Chmod命令 (续) 改变多个文件的权限 chmod 755 file1 file2 file3 递归操作 (-R) chmod -R 700 emails chmod -R 700 . * du 、df 命令 $ du /u/mingming 123 /u/mingming/emails 89 /u/mingming/letters … 2190 /u/mingming $ du -s /u/mingming 2190 /u/mingming du统计目录使用磁盘空间的情况。 格式:du [选项] 目录名 参数选项: -a:显示所有文件的统计数,而不仅仅是目录的统计数。 -s:只显示磁盘的总体使用情况。 -b:以字节为单位显示信息,缺省时是块(1024字节) * df统

您可能关注的文档

文档评论(0)

skvdnd51 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档