创建文件夹 test1103
[root@hadoop tools]# mkdir test1103
[root@hadoop tools]# ll
总用量 8
drwxr-xr-x 2 root root 24 11月 3 17:47 j_t1103
drwxr-xr-x 2 root root 24 11月 3 15:48 t_1103
drwxr-xr-x 2 root root 6 11月 3 19:15 test1103
-rwx-wx--x 1 root root 225 11月 3 14:09 test_1103.txt
-rw-r--r-- 1 root root 87 11月 2 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 11月 3 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 11月 3 19:22 t_1103.tar.gz
-rw-r--r-- 1 root root 89 11月 3 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 11月 3 19:22 t_1103.tar.gz
-rw-r--r-- 1 root root 89 11月 3 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 11月 3 19:22 t1103.tar.gz
-rw-r--r-- 1 root root 89 11月 3 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 11月 3 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 11月 3 19:26 t_1103.tar.gz
-rw-r--r-- 1 root root 186 11月 3 19:22 t1103.tar.gz
-rw-r--r-- 1 root root 1 11月 3 17:47 t_1103.txt
-rw-r--r-- 1 root root 89 11月 3 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 11月 3 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 11月 3 19:17 rm_t1103.txt