1.在root用户的主目录下创建两个目录分别为haha和hehe,复制hehe目录到haha目录并重命名为apple。
[root@localhost ~]# mkdir haha
[root@localhost ~]# mkdir hehe
[root@localhost ~]# cp -r hehe haha
[root@localhost ~]# cd haha
[root@localhost haha]# mv hehe apple
[root@localhost haha]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 02:37 apple
2.将hehe目录移动到apple目录下,在haha目录下创建一个普通文件为heihei.txt。
[root@localhost ~]# mv hehe haha
[root@localhost ~]# cd haha
[root@localhost haha]# mv hehe apple
[root@localhost haha]# cd apple
[root@localhost apple]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 02:42 hehe
[root@localhost ~]# cd haha
[root@localhost haha]# touch heihei.txt
[root@localhost haha]# ll
total 0
drwxr-xr-x. 3 root root 18 Oct 26 02:44 apple
-rw-r--r--. 1 root root 0 Oct 26 02:44 heihei.txt
3.在/usr/local/etc下创建一个目录为mulu1,创建一个普通文件为wenjian1。在/usr/local/bin创建一个目录为mulu2,创建一个普通文件为wenjian2。创建成功后使用ls命令以及它的选项来检查该题的正确性
[root@localhost ~]# cd /usr/local/etc
[root@localhost etc]# touch wenjian1
[root@localhost etc]# ls
wenjian1
[root@localhost etc]# cd ~
[root@localhost ~]# cd /usr/local/bin
[root@localhost bin]# touch wenjian2
[root@localhost bin]# mkdir mulu2
[root@localhost bin]# ls
mulu2 wenjian2
4.创建目录/test/sysroot在该目录下创建三个文件a,b,c 之后再将sysroot目录移动到/tmp目录下改名为sys保证目录下三个文件也存在
[root@localhost ~]# mkdir -p /test/sysroot
[root@localhost test]# cd sysroot
[root@localhost sysroot]# touch a b c
[root@localhost sysroot]# cd ~
[root@localhost ~]# mv /test/sysroot /tmp
[root@localhost tmp]# mv sysroot sys
[root@localhost tmp]# cd sys
[root@localhost sys]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 26 02:57 a
-rw-r--r--. 1 root root 0 Oct 26 02:57 b
-rw-r--r--. 1 root root 0 Oct 26 02:57 c
5.删除 /tmp/sys/a 文件。
[root@localhost sys]# rm /tmp/sys/a
rm: remove regular empty file '/tmp/sys/a'? y
[root@localhost sys]# cd /tem/sys
bash: cd: /tem/sys: No such file or directory
[root@localhost sys]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 26 02:57 b
-rw-r--r--. 1 root root 0 Oct 26 02:57 c
6.目录/tmp下创建4个目录,并在这四个目录下分别创建一个test目录
[root@localhost tmp]# mkdir /mulu{1..4}
[root@localhost tmp]# mkdir /mulu{1..4}/test
[root@localhost tmp]# cd /mulu1
[root@localhost mulu1]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 03:15 test
[root@localhost mulu1]# cd /mulu2
[root@localhost mulu2]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 03:15 test
[root@localhost mulu2]# cd /mulu3
[root@localhost mulu3]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 03:15 test
[root@localhost mulu3]# cd /mulu4
[root@localhost mulu4]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 03:15 test
7.创建一个test目录,在该目录下创建一个文件,内容写 nano
[root@localhost ~]# touch /test/nano
8.在/dir下创建目录dir2和文件file1,移动文件file1到上面创建的test目录中,将目录dir2复制到test目录中
[root@localhost ~]# mkdir /dir/dir2
[root@localhost ~]# touch /dir/file1
[root@localhost ~]# mv /dir/file1 /test
[root@localhost ~]# cp -r /dir/dir2 /test
[root@localhost ~]# cd /test
[root@localhost test]# ll
drwxr-xr-x. 2 root root 6 Oct 26 03:23 dir2
-rw-r--r--. 1 root root 0 Oct 26 03:22 file1
-rw-r--r--. 1 root root 0 Oct 26 03:19 nano
[root@localhost ~]# cd /dir
[root@localhost dir]# ll
total 0
drwxr-xr-x. 2 root root 6 Oct 26 03:21 dir2