第三次云计算课程作业linux

1.#创建目录(尝试以下通过一条命令实现)

在/mnt下创建boot和sysroot目  

在/mnt/boot下创建grub目录   

在/mnt/sysroot下创建proc,sys,bin,sbin,lib,usr,var,etc,dev,home,root,tmp

在/mnt/sysroot/usr下创建bin,sbin,lib

在/mnt/sysroot/lib下创建modules

在/mnt/sysroot/var下创建run,log,lock

在/mnt/sysroot/etc下创建init.d

[root@localhost ~]#  mkdir -p /mnt/boot/grub /mnt/sysroot{proc,sys,bin,sbin,lib,usr,var,etc,dev,home,root,tmp} /mnt/sysroot/usr/{bin,sbin,lib} /mnt/sysroot/lib/modules /mnt/sysroot/var{run,log,lock} /mnt/sysroot/ect/initd
[root@localhost ~]# ll
总用量 8
drwxr-xr-x. 2 root root    6 11月 19 22:12 公共
drwxr-xr-x. 2 root root    6 11月 19 22:12 模板
drwxr-xr-x. 2 root root    6 11月 19 22:12 视频
drwxr-xr-x. 2 root root    6 11月 19 22:12 图片
drwxr-xr-x. 2 root root    6 11月 19 22:12 文档
drwxr-xr-x. 2 root root    6 11月 19 22:24 下载
drwxr-xr-x. 2 root root    6 11月 19 22:12 音乐
drwxr-xr-x. 2 root root    6 11月 19 22:12 桌面
-rw-------. 1 root root 1272 11月 19 20:19 anaconda-ks.cfg
-rw-r--r--. 1 root root 1609 11月 19 22:10 initial-setup-ks.cfg
[root@localhost ~]# ll /mnt
总用量 0
drwxr-xr-x. 3 root root 18 11月 25 17:15 boot
drwxr-xr-x. 2 root root  6 11月 19 20:13 hgfs
drwxr-xr-x. 8 root root 82 11月 25 17:15 sysroot
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootbin
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootdev
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootetc
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysroothome
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootlib
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootproc
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootroot
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootsbin
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootsys
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysroottmp
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootusr
drwxr-xr-x. 2 root root  6 11月 25 17:15 sysrootvar
[root@localhost ~]# ll /mnt/boot
总用量 0
drwxr-xr-x. 2 root root 6 11月 25 17:15 grub
[root@localhost ~]# ll /mnt/sysroot
总用量 0
drwxr-xr-x. 3 root root 19 11月 25 17:15 ect
drwxr-xr-x. 3 root root 21 11月 25 17:15 lib
drwxr-xr-x. 5 root root 40 11月 25 17:15 usr
drwxr-xr-x. 2 root root  6 11月 25 17:15 varlock
drwxr-xr-x. 2 root root  6 11月 25 17:15 varlog
drwxr-xr-x. 2 root root  6 11月 25 17:15 varrun
[root@localhost ~]# ll /mnt/sysroot/usr
总用量 0
drwxr-xr-x. 2 root root 6 11月 25 17:15 bin
drwxr-xr-x. 2 root root 6 11月 25 17:15 lib
drwxr-xr-x. 2 root root 6 11月 25 17:15 sbin

2.如何一次性在/test目录创建以abc表示的100个文件,例如abc1,abc2,abc3,..abc100

[root@localhost ~]# mkdir -p test
[root@localhost ~]# touch /root/test/abc{1..100}
[root@localhost ~]# ll /root/test
总用量 0
-rw-r--r--. 1 root root 0 11月 25 17:27 abc1
-rw-r--r--. 1 root root 0 11月 25 17:27 abc10
-rw-r--r--. 1 root root 0 11月 25 17:27 abc100
-rw-r--r--. 1 root root 0 11月 25 17:27 abc11
-rw-r--r--. 1 root root 0 11月 25 17:27 abc12
-rw-r--r--. 1 root root 0 11月 25 17:27 abc13
-rw-r--r--. 1 root root 0 11月 25 17:27 abc14
-rw-r--r--. 1 root root 0 11月 25 17:27 abc15
-rw-r--r--. 1 root root 0 11月 25 17:27 abc16
-rw-r--r--. 1 root root 0 11月 25 17:27 abc17
-rw-r--r--. 1 root root 0 11月 25 17:27 abc18
-rw-r--r--. 1 root root 0 11月 25 17:27 abc19
-rw-r--r--. 1 root root 0 11月 25 17:27 abc2
-rw-r--r--. 1 root root 0 11月 25 17:27 abc20
-rw-r--r--. 1 root root 0 11月 25 17:27 abc21
-rw-r--r--. 1 root root 0 11月 25 17:27 abc22
-rw-r--r--. 1 root root 0 11月 25 17:27 abc23
-rw-r--r--. 1 root root 0 11月 25 17:27 abc24
-rw-r--r--. 1 root root 0 11月 25 17:27 abc25
-rw-r--r--. 1 root root 0 11月 25 17:27 abc26
-rw-r--r--. 1 root root 0 11月 25 17:27 abc27
-rw-r--r--. 1 root root 0 11月 25 17:27 abc28
-rw-r--r--. 1 root root 0 11月 25 17:27 abc29
-rw-r--r--. 1 root root 0 11月 25 17:27 abc3
-rw-r--r--. 1 root root 0 11月 25 17:27 abc30
-rw-r--r--. 1 root root 0 11月 25 17:27 abc31
-rw-r--r--. 1 root root 0 11月 25 17:27 abc32
-rw-r--r--. 1 root root 0 11月 25 17:27 abc33
-rw-r--r--. 1 root root 0 11月 25 17:27 abc34
-rw-r--r--. 1 root root 0 11月 25 17:27 abc35
-rw-r--r--. 1 root root 0 11月 25 17:27 abc36
-rw-r--r--. 1 root root 0 11月 25 17:27 abc37
-rw-r--r--. 1 root root 0 11月 25 17:27 abc38
-rw-r--r--. 1 root root 0 11月 25 17:27 abc39
-rw-r--r--. 1 root root 0 11月 25 17:27 abc4
-rw-r--r--. 1 root root 0 11月 25 17:27 abc40
-rw-r--r--. 1 root root 0 11月 25 17:27 abc41
-rw-r--r--. 1 root root 0 11月 25 17:27 abc42
-rw-r--r--. 1 root root 0 11月 25 17:27 abc43
-rw-r--r--. 1 root root 0 11月 25 17:27 abc44
-rw-r--r--. 1 root root 0 11月 25 17:27 abc45
-rw-r--r--. 1 root root 0 11月 25 17:27 abc46
-rw-r--r--. 1 root root 0 11月 25 17:27 abc47
-rw-r--r--. 1 root root 0 11月 25 17:27 abc48
-rw-r--r--. 1 root root 0 11月 25 17:27 abc49
-rw-r--r--. 1 root root 0 11月 25 17:27 abc5
-rw-r--r--. 1 root root 0 11月 25 17:27 abc50
-rw-r--r--. 1 root root 0 11月 25 17:27 abc51
-rw-r--r--. 1 root root 0 11月 25 17:27 abc52
-rw-r--r--. 1 root root 0 11月 25 17:27 abc53
-rw-r--r--. 1 root root 0 11月 25 17:27 abc54
-rw-r--r--. 1 root root 0 11月 25 17:27 abc55
-rw-r--r--. 1 root root 0 11月 25 17:27 abc56
-rw-r--r--. 1 root root 0 11月 25 17:27 abc57
-rw-r--r--. 1 root root 0 11月 25 17:27 abc58
-rw-r--r--. 1 root root 0 11月 25 17:27 abc59
-rw-r--r--. 1 root root 0 11月 25 17:27 abc6
-rw-r--r--. 1 root root 0 11月 25 17:27 abc60
-rw-r--r--. 1 root root 0 11月 25 17:27 abc61
-rw-r--r--. 1 root root 0 11月 25 17:27 abc62
-rw-r--r--. 1 root root 0 11月 25 17:27 abc63
-rw-r--r--. 1 root root 0 11月 25 17:27 abc64
-rw-r--r--. 1 root root 0 11月 25 17:27 abc65
-rw-r--r--. 1 root root 0 11月 25 17:27 abc66
-rw-r--r--. 1 root root 0 11月 25 17:27 abc67
-rw-r--r--. 1 root root 0 11月 25 17:27 abc68
-rw-r--r--. 1 root root 0 11月 25 17:27 abc69
-rw-r--r--. 1 root root 0 11月 25 17:27 abc7
-rw-r--r--. 1 root root 0 11月 25 17:27 abc70
-rw-r--r--. 1 root root 0 11月 25 17:27 abc71
-rw-r--r--. 1 root root 0 11月 25 17:27 abc72
-rw-r--r--. 1 root root 0 11月 25 17:27 abc73
-rw-r--r--. 1 root root 0 11月 25 17:27 abc74
-rw-r--r--. 1 root root 0 11月 25 17:27 abc75
-rw-r--r--. 1 root root 0 11月 25 17:27 abc76
-rw-r--r--. 1 root root 0 11月 25 17:27 abc77
-rw-r--r--. 1 root root 0 11月 25 17:27 abc78
-rw-r--r--. 1 root root 0 11月 25 17:27 abc79
-rw-r--r--. 1 root root 0 11月 25 17:27 abc8
-rw-r--r--. 1 root root 0 11月 25 17:27 abc80
-rw-r--r--. 1 root root 0 11月 25 17:27 abc81
-rw-r--r--. 1 root root 0 11月 25 17:27 abc82
-rw-r--r--. 1 root root 0 11月 25 17:27 abc83
-rw-r--r--. 1 root root 0 11月 25 17:27 abc84
-rw-r--r--. 1 root root 0 11月 25 17:27 abc85
-rw-r--r--. 1 root root 0 11月 25 17:27 abc86
-rw-r--r--. 1 root root 0 11月 25 17:27 abc87
-rw-r--r--. 1 root root 0 11月 25 17:27 abc88
-rw-r--r--. 1 root root 0 11月 25 17:27 abc89
-rw-r--r--. 1 root root 0 11月 25 17:27 abc9
-rw-r--r--. 1 root root 0 11月 25 17:27 abc90
-rw-r--r--. 1 root root 0 11月 25 17:27 abc91
-rw-r--r--. 1 root root 0 11月 25 17:27 abc92
-rw-r--r--. 1 root root 0 11月 25 17:27 abc93
-rw-r--r--. 1 root root 0 11月 25 17:27 abc94
-rw-r--r--. 1 root root 0 11月 25 17:27 abc95
-rw-r--r--. 1 root root 0 11月 25 17:27 abc96
-rw-r--r--. 1 root root 0 11月 25 17:27 abc97
-rw-r--r--. 1 root root 0 11月 25 17:27 abc98
-rw-r--r--. 1 root root 0 11月 25 17:27 abc99


3.复制/mnt/boot目录文件到/test并改名为/boot.bak

[root@localhost ~]# cp -r  mnt/boot ./test/boot.bak
[root@localhost ~]# ll test/boot.bak
总用量 0
[root@localhost ~]# 

4.复制/test所有有9字符命名的文件到/pub下

[root@localhost ~]# cp -r /test*9* /pub

5.移动/test所有有1字符命名的文件到/pub目录下

[root@localhost ~]# mv -r test*1* /pub

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜深邃星如尘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值