1103课后作业

创建文件夹 test1103

[root@hadoop tools]# mkdir test1103
[root@hadoop tools]# ll
总用量 8
drwxr-xr-x 2 root root  24 113 17:47 j_t1103
drwxr-xr-x 2 root root  24 113 15:48 t_1103
drwxr-xr-x 2 root root   6 113 19:15 test1103
-rwx-wx--x 1 root root 225 113 14:09 test_1103.txt
-rw-r--r-- 1 root root  87 112 19:32 Zname

在文件夹 test1103 下创建 t1103.txt 文件

[root@hadoop tools]# cd test1103/
[root@hadoop test1103]# touch t1103.txt
[root@hadoop test1103]# ll
总用量 0
-rw-r--r-- 1 root root 0 113 19:16 t1103.txt

编辑 t1103.txt 这个文件

[root@hadoop test1103]# vim t1103.txt 

查看这个文件 t1103.txt 的前 n 行或者后 n 行

[root@hadoop test1103]# head -2 ./t1103.txt 
 hello    hadoop !!!
select *  from  emp e  
[root@hadoop test1103]# tail -3 t1103.txt 
inner join  dept d 
on e.deptno = d.deptno

将 test1103 这个文件夹打包压缩 压缩包命名为 t_1103.tar.gz

[root@hadoop test1103]# tar -zcvf t_1103.tar.gz ./t1103.txt 
./t1103.txt
[root@hadoop test1103]# ll
总用量 8
-rw-r--r-- 1 root root 186 113 19:22 t_1103.tar.gz
-rw-r--r-- 1 root root  89 113 19:17 t1103.txt

将 t_1103.tar.gz 这个压缩包的解压到自己指定的路径下

[root@hadoop test1103]# tar -zxvf t_1103.tar.gz -C /app/tools/j_t1103/
./t1103.txt

将 t_1103.tar.gz 这个压缩包的复制到自己指定的路径下

[root@hadoop test1103]# cp t_1103.tar.gz  /app/tools/j_t1103/
[root@hadoop test1103]# ll
总用量 8
-rw-r--r-- 1 root root 186 113 19:22 t_1103.tar.gz
-rw-r--r-- 1 root root  89 113 19:17 t1103.txt

将 t_1103.tar.gz 这个压缩包的剪切到自己指定的路径下

[root@hadoop test1103]# mv t_1103.tar.gz  t1103.tar.gz
[root@hadoop test1103]# ll
总用量 8
-rw-r--r-- 1 root root 186 113 19:22 t1103.tar.gz
-rw-r--r-- 1 root root  89 113 19:17 t1103.txt
[root@hadoop test1103]# mv t1103.t /app/tools/j_t1103/
mv: 无法获取"t1103.t" 的文件状态(stat): 没有那个文件或目录
[root@hadoop test1103]# mv t1103.tar.gz /app/tools/j_t1103/
[root@hadoop test1103]# ll
总用量 4
-rw-r--r-- 1 root root 89 113 19:17 t1103.txt
[root@hadoop test1103]# cd ..
[root@hadoop tools]# cd j_t1103/
[root@hadoop j_t1103]# ll
总用量 16
-rw-r--r-- 1 root root 186 113 19:26 t_1103.tar.gz
-rw-r--r-- 1 root root 186 113 19:22 t1103.tar.gz
-rw-r--r-- 1 root root   1 113 17:47 t_1103.txt
-rw-r--r-- 1 root root  89 113 19:17 t1103.txt

重命名 test1103 这个文件夹下的 t1103.txt为 rm_t1103.txt

[root@hadoop j_t1103]# cd ..
[root@hadoop tools]# cd test1103/
[root@hadoop test1103]# ll
总用量 4
-rw-r--r-- 1 root root 89 113 19:17 t1103.txt
[root@hadoop test1103]# mv t1103.txt  rm_t1103.txt
[root@hadoop test1103]# ll
总用量 4
-rw-r--r-- 1 root root 89 113 19:17 rm_t1103.txt
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

只会HelloWorld的华娃

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值