复习

 1.当前目录下有a,b,c三个文件和一个目录Dir
 -分别使用tar,rar,zip命令将三个文件和目录压缩为一个文件
 -将压缩好的文件压缩到/home/itheima目录中
tar zcvf test.tar.gz a b c Dir/
tar zxvf test.tar.gz -C /home/itheima
 
rar a test a b c Dir/ -r
rar x test.rar /home/itheima
 
zip myzip a b c Dir/ -r
unzip myzip.zip -d /home/itheima

 2.写出命令查找宿主目录下文件中含有"hello,world" 字符串的文件,并显示行号
grep -r "hello,world" ~ -n
~ 宿主目录
3.创建软链接
ln -s 文件名 软链接的名字
 文件名:使用绝对路径
4.现有一个文件hello.txt, 文件访问权限为 rwxrw-rw-
 ○ 使用文字设定法将文件所属组和其他人添加执行权限 x
 ○ 使用数字设定法去掉文件所有者的读写权限
 chmod 766 hello
chmod -600 hello

chmod go+x hello
5.写出命令查找宿主目录下文件大于100k小于10M的文件
find ~ -size +100k -size -10M
6.将NewDir目录中的内容拷贝到另一个已经存在的空目录(test)
cp NewDir/*  test -r
7.删除newDir目录下的所有文件
rm newDir/* -r
8.创建test目录,在里面创建aa bb cc三个目录
mkdir test/aa test/b2 test/cc -p 
posted @ 2018-02-21 12:30  1斑点  阅读(101)  评论(0编辑  收藏  举报