mkdir命令用于创建空白的目录,格式为“mkdir [选项] 目录”
选项与参数:
例如:在桌面创建多级目录:
[centos@centtos7 Desktop]$ mkdir -p dog/cat/hei
创建目录的同时给分配权限:
mkdir -m 711 test2
选项与参数:
删除test目录:
[centos@centtos7 Desktop]$ rmdir test
一次删除多级目录:
[centos@centtos7 Desktop]$ rmdir -p dog/cat/hei
touch命令用于创建空白文件或设置文件的时间,格式为“touch [选项] [文件]”

我们先使用ls命令查看一个文件的修改时间,然后修改这个文件,最后再通过touch命令把修改后的文件时间设置成修改之间的时间 (很多黑客就是这样做的)
接下来演示这个黑客常见的操作:
[root@centtos7 dahe]# ls -l hello.txt
-rw-r--r--. 1 root root 39 Oct 4 06:18 hello.txt
[root@centtos7 dahe]# vim hello.txt
[root@centtos7 dahe]# ls -l hello.txt
-rw-r--r--. 1 root root 44 Oct 4 08:23 hello.txt
[root@centtos7 dahe]# touch -d "2022-10-04 06:18" hello.txt
[root@centtos7 dahe]# ls -l hello.txt
-rw-r--r--. 1 root root 44 Oct 4 06:18 hello.txt
cp命令用于复制文件或目录,格式为“cp [选项] 源文件 目标文件”
选项与参数:
将当前目录的hello.txt复制到当前目录的test文件夹下:
cp hello.txt test
将目录test复制到test2目录下:
[centos@centtos7 Desktop]$ cp -r test test2
rm命令用于删除文件或目录,格式为“rm [选项] 文件”
选项与参数:
删除桌面的test文件夹(文件夹里面非空):
[centos@centtos7 Desktop]$ rm -r test
mv命令用于剪切文件或将文件重命名,格式为“mv [选项] 源文件 [目标路径|目标文件名]”
选项与参数:
将桌面的test2文件夹改名为test:
[centos@centtos7 Desktop]$ mv test2 test
file命令用于查看文件的类型:
[root@centtos7 dahe]# file hello.txt
hello.txt: ASCII text