作业2
1.在root用户的主目录下创建两个目录分别为haha和hehe,复制hehe目录到haha目录并重命名为apple。
创建 haha hehe
[root@localhost ~]# mkdir haha hehe
将hehe复制到haha下并且重命名为apple
[root@localhost ~]# cp -r hehe /root/haha/apple
检查
生成 目录 haha hehe
[root@localhost ~]# ll
total 16
drwxr-xr-x. 2 root root 6 Mar 16 16:10 haha
drwxr-xr-x. 2 root root 6 Mar 16 16:10 hehe
生成目录apple
[root@localhost ~]# ll haha
total 0
drwxr-xr-x. 2 root root 6 Mar 16 16:12 apple
2.将hehe目录移动到apple目录下,在haha目录下创建一个普通文件为heihei.txt。
将hehe 移动到 /root/haha/apple下
[root@localhost ~]# mv hehe /root/haha/apple
转移成功
[root@localhost ~]# ll haha/apple
total 0
drwxr-xr-x. 2 root root 6 Mar 16 16:10 hehe
4.在/usr/local/etc下创建一个目录为mulu1,创建一个普通文件为wenjian1。在/usr/local/bin创建一个目录为mulu2,创建一个普通文件为wenjian2。创建成功后使用ls命令以及它的选项来检查该题的正确性
进入/usr/local/etc
[root@localhost ~]# cd /usr/local/etc
生成目录 mulu1
[root@localhost etc]# mkdir mulu1
生成文件 wenjian1
[root@localhost etc]# touch wenjian1
生成目录 mulu2
[root@localhost etc]# mkdir /usr/local/bin/mulu2
生成文件 wenjian2
[root@localhost etc]# touch /usr/local/bin/wenjian2
检查目录/usr/local/etc
[root@localhost etc]# ll
total 0
drwxr-xr-x. 2 root root 6 Mar 16 16:17 mulu1
-rw-r–r--. 1 root root 0 Mar 16 16:17 wenjian1
检查目录/usr/local/bin
[root@localhost etc]# ll /usr/local/bin
total 0
drwxr-xr-x. 2 root root 6 Mar 16 16:19 mulu2
-rw-r–r--. 1 root root 0 Mar 16 16:19 wenjian2