1.在root用户的主目录下创建两个目录分别为haha和hehe,复制hehe目录到haha目录并重命名为apple。

1.在root用户的主目录下创建两个目录分别为haha和hehe,复制hehe目录到haha目录并重命名为apple。

[root@xiaoyun ~]# mkdir haha hehe
[root@xiaoyun ~]# cp hehe /root/haha/apple
[root@xiaoyun ~]# ll /root
drwxr-xr-x. 2 root  root      6 Oct 24 09:19 haha
drwxr-xr-x. 2 root  root      6 Oct 24 09:19 hehe
[root@xiaoyun ~]# cp -r  hehe /root/haha/apple
[root@xiaoyun ~]# ll /root/haha/
total 0
drwxr-xr-x. 2 root root 6 Oct 24 09:23 apple

2.将hehe目录移动到apple目录下,在haha目录下创建一个普通文件为heihei.txt。

[root@xiaoyun ~]# touch /root/haha/heihei.txt
[root@xiaoyun ~]# ll /root/haha
total 0
drwxr-xr-x. 2 root root 6 Oct 24 09:23 apple
-rw-r--r--. 1 root root 0 Oct 24 09:53 heihei.txt


4.在/usr/local/etc下创建一个目录为mulu1,创建一个普通文件为wenjian1。在/usr/local/bin创建一个目录为mulu2,创建一个普通文件为wenjian2。创建成功后使用ls命令以及它的选项来检查该题的正确性

[root@xiaoyun ~]# mkdir /usr/local/etc/mulu1
[root@xiaoyun ~]# touch /usr/local/etc/wenjian1
[root@xiaoyun ~]# mkdir /usr/local/bin/mulu2
[root@xiaoyun ~]# touch /usr/local/bin/wenjian2

[root@xiaoyun ~]# ll  /usr/local/etc
total 0
drwxr-xr-x. 2 root root 6 Oct 24 09:55 mulu1
-rw-r--r--. 1 root root 0 Oct 24 09:55 wenjian1
[root@xiaoyun ~]# ll /usr/local/bin/
total 0
drwxr-xr-x. 2 root root 6 Oct 24 09:56 mulu2
-rw-r--r--. 1 root root 0 Oct 24 09:56 wenjian2

5.创建目录/test/sysroot在该目录下创建三个文件a,b,c 之后再将sysroot目录移动到/tmp目录下改名为sys保证目录下三个文件也存在

-rw-r--r--. 1 root root 0 Oct 24 09:56 wenjian2
[root@xiaoyun ~]# mkdir /test/sysroot
[root@xiaoyun ~]# touch /test/sysroot/{a,b,c}


[root@xiaoyun ~]# mv /test/sysroot/ /tmp/sys
[root@xiaoyun ~]# cd /tmp/sys
[root@xiaoyun sys]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 24 10:01 a
-rw-r--r--. 1 root root 0 Oct 24 10:01 b
-rw-r--r--. 1 root root 0 Oct 24 10:01 c

6.删除 /tmp/sys/a 文件。

[root@xiaoyun sys]# rm /tmp/sys/a
rm: remove regular empty file '/tmp/sys/a'? y

7.目录/tmp下创建4个目录,并在这四个目录下分别创建一个test目录

[root@xiaoyun ~]# mkdir -p /tmp/mulu{1..4}/test

8.创建一个test目录,在该目录下创建一个文件,内容写 nano

[root@xiaoyun ~]# mkdir test
[root@xiaoyun ~]# touch test/neirong.txt
[root@xiaoyun ~]# vi test/neirong.txt 
[root@xiaoyun ~]# cat test/neirong.txt 
nano

9.在/dir下创建目录dir2和文件file1,移动文件file1到上面创建的test目录中,将目录dir2复制到test目录中

[root@xiaoyun bin]# mkdir /dir/dir2
[root@xiaoyun bin]# touch /dir/file1
[root@xiaoyun ~]# mv /dir/file1 /root/test
[root@xiaoyun ~]# mv /dir/dir2 /root/test
[root@xiaoyun ~]# ls /root/test
dir2  file1  neirong.txt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值