RHCSA——小练习

1、在根下创建一个叫做test的目录

[root@localhost ~]# cd /
[root@localhost /]# mkdir test

2、在test的目录下创建三个普通文件file1 file2 file3

[root@localhost /]# cd test
[root@localhost test]# touch file{1..3}
[root@localhost test]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 29 22:36 file1
-rw-r--r--. 1 root root 0 Oct 29 22:36 file2
-rw-r--r--. 1 root root 0 Oct 29 22:36 file3

3、给file1创建一个软链接aa,给file2创建两个硬链接

[root@localhost test]# ln -s file1 aa
[root@localhost test]# ln file2 bb
[root@localhost test]# ln file2 cc
[root@localhost test]# ll
total 0
lrwxrwxrwx. 1 root root 5 Oct 29 22:36 aa -> file1
-rw-r--r--. 3 root root 0 Oct 29 22:36 bb
-rw-r--r--. 3 root root 0 Oct 29 22:36 cc
-rw-r--r--. 1 root root 0 Oct 29 22:36 file1
-rw-r--r--. 3 root root 0 Oct 29 22:36 file2
-rw-r--r--. 1 root root 0 Oct 29 22:36 file3

4、在test目录下创建一个ceshi的目录,在ceshi的目录下创建a1-a8,b1-b8,ac1-ac8的文件

[root@localhost test]# mkdir ceshi

[root@localhost test]# cd ceshi
[root@localhost ceshi]# touch a{1..8} b{1..8} ac{1..8}
[root@localhost ceshi]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 29 22:39 a1
-rw-r--r--. 1 root root 0 Oct 29 22:39 a2
-rw-r--r--. 1 root root 0 Oct 29 22:39 a3
-rw-r--r--. 1 root root 0 Oct 29 22:39 a4
-rw-r--r--. 1 root root 0 Oct 29 22:39 a5
-rw-r--r--. 1 root root 0 Oct 29 22:39 a6
-rw-r--r--. 1 root root 0 Oct 29 22:39 a7
-rw-r--r--. 1 root root 0 Oct 29 22:39 a8
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac1
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac2
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac3
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac4
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac5
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac6
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac7
-rw-r--r--. 1 root root 0 Oct 29 22:39 ac8
-rw-r--r--. 1 root root 0 Oct 29 22:39 b1
-rw-r--r--. 1 root root 0 Oct 29 22:39 b2
-rw-r--r--. 1 root root 0 Oct 29 22:39 b3
-rw-r--r--. 1 root root 0 Oct 29 22:39 b4
-rw-r--r--. 1 root root 0 Oct 29 22:39 b5
-rw-r--r--. 1 root root 0 Oct 29 22:39 b6
-rw-r--r--. 1 root root 0 Oct 29 22:39 b7
-rw-r--r--. 1 root root 0 Oct 29 22:39 b8

5、在test目录下创建一个kaoshi的目录,在该目录下创建1-100个文件

[root@localhost test]# mkdir kaoshi
[root@localhost test]# cd kaoshi
[root@localhost kaoshi]# touch {1..100}
[root@localhost kaoshi]# ll
total 0
-rw-r--r--. 1 root root 0 Oct 29 22:48 1
-rw-r--r--. 1 root root 0 Oct 29 22:48 10
-rw-r--r--. 1 root root 0 Oct 29 22:48 100
-rw-r--r--. 1 root root 0 Oct 29 22:48 11
-rw-r--r--. 1 root root 0 Oct 29 22:48 12
-rw-r--r--. 1 root root 0 Oct 29 22:48 13
-rw-r--r--. 1 root root 0 Oct 29 22:48 14
-rw-r--r--. 1 root root 0 Oct 29 22:48 15
-rw-r--r--. 1 root root 0 Oct 29 22:48 16
-rw-r--r--. 1 root root 0 Oct 29 22:48 17
-rw-r--r--. 1 root root 0 Oct 29 22:48 18
-rw-r--r--. 1 root root 0 Oct 29 22:48 19
-rw-r--r--. 1 root root 0 Oct 29 22:48 2
-rw-r--r--. 1 root root 0 Oct 29 22:48 20
-rw-r--r--. 1 root root 0 Oct 29 22:48 21
-rw-r--r--. 1 root root 0 Oct 29 22:48 22
-rw-r--r--. 1 root root 0 Oct 29 22:48 23
-rw-r--r--. 1 root root 0 Oct 29 22:48 24
-rw-r--r--. 1 root root 0 Oct 29 22:48 25
-rw-r--r--. 1 root root 0 Oct 29 22:48 26
-rw-r--r--. 1 root root 0 Oct 29 22:48 27
-rw-r--r--. 1 root root 0 Oct 29 22:48 28
-rw-r--r--. 1 root root 0 Oct 29 22:48 29
-rw-r--r--. 1 root root 0 Oct 29 22:48 3
-rw-r--r--. 1 root root 0 Oct 29 22:48 30
-rw-r--r--. 1 root root 0 Oct 29 22:48 31
-rw-r--r--. 1 root root 0 Oct 29 22:48 32
-rw-r--r--. 1 root root 0 Oct 29 22:48 33
-rw-r--r--. 1 root root 0 Oct 29 22:48 34
-rw-r--r--. 1 root root 0 Oct 29 22:48 35
-rw-r--r--. 1 root root 0 Oct 29 22:48 36
-rw-r--r--. 1 root root 0 Oct 29 22:48 37
-rw-r--r--. 1 root root 0 Oct 29 22:48 38
-rw-r--r--. 1 root root 0 Oct 29 22:48 39
-rw-r--r--. 1 root root 0 Oct 29 22:48 4
-rw-r--r--. 1 root root 0 Oct 29 22:48 40
-rw-r--r--. 1 root root 0 Oct 29 22:48 41
-rw-r--r--. 1 root root 0 Oct 29 22:48 42
-rw-r--r--. 1 root root 0 Oct 29 22:48 43
-rw-r--r--. 1 root root 0 Oct 29 22:48 44
-rw-r--r--. 1 root root 0 Oct 29 22:48 45
-rw-r--r--. 1 root root 0 Oct 29 22:48 46
-rw-r--r--. 1 root root 0 Oct 29 22:48 47
-rw-r--r--. 1 root root 0 Oct 29 22:48 48
-rw-r--r--. 1 root root 0 Oct 29 22:48 49
-rw-r--r--. 1 root root 0 Oct 29 22:48 5
-rw-r--r--. 1 root root 0 Oct 29 22:48 50
-rw-r--r--. 1 root root 0 Oct 29 22:48 51
-rw-r--r--. 1 root root 0 Oct 29 22:48 52
-rw-r--r--. 1 root root 0 Oct 29 22:48 53
-rw-r--r--. 1 root root 0 Oct 29 22:48 54
-rw-r--r--. 1 root root 0 Oct 29 22:48 55
-rw-r--r--. 1 root root 0 Oct 29 22:48 56
-rw-r--r--. 1 root root 0 Oct 29 22:48 57
-rw-r--r--. 1 root root 0 Oct 29 22:48 58
-rw-r--r--. 1 root root 0 Oct 29 22:48 59
-rw-r--r--. 1 root root 0 Oct 29 22:48 6
-rw-r--r--. 1 root root 0 Oct 29 22:48 60
-rw-r--r--. 1 root root 0 Oct 29 22:48 61
-rw-r--r--. 1 root root 0 Oct 29 22:48 62
-rw-r--r--. 1 root root 0 Oct 29 22:48 63
-rw-r--r--. 1 root root 0 Oct 29 22:48 64
-rw-r--r--. 1 root root 0 Oct 29 22:48 65
-rw-r--r--. 1 root root 0 Oct 29 22:48 66
-rw-r--r--. 1 root root 0 Oct 29 22:48 67
-rw-r--r--. 1 root root 0 Oct 29 22:48 68
-rw-r--r--. 1 root root 0 Oct 29 22:48 69
-rw-r--r--. 1 root root 0 Oct 29 22:48 7
-rw-r--r--. 1 root root 0 Oct 29 22:48 70
-rw-r--r--. 1 root root 0 Oct 29 22:48 71
-rw-r--r--. 1 root root 0 Oct 29 22:48 72
-rw-r--r--. 1 root root 0 Oct 29 22:48 73
-rw-r--r--. 1 root root 0 Oct 29 22:48 74
-rw-r--r--. 1 root root 0 Oct 29 22:48 75
-rw-r--r--. 1 root root 0 Oct 29 22:48 76
-rw-r--r--. 1 root root 0 Oct 29 22:48 77
-rw-r--r--. 1 root root 0 Oct 29 22:48 78
-rw-r--r--. 1 root root 0 Oct 29 22:48 79
-rw-r--r--. 1 root root 0 Oct 29 22:48 8
-rw-r--r--. 1 root root 0 Oct 29 22:48 80
-rw-r--r--. 1 root root 0 Oct 29 22:48 81
-rw-r--r--. 1 root root 0 Oct 29 22:48 82
-rw-r--r--. 1 root root 0 Oct 29 22:48 83
-rw-r--r--. 1 root root 0 Oct 29 22:48 84
-rw-r--r--. 1 root root 0 Oct 29 22:48 85
-rw-r--r--. 1 root root 0 Oct 29 22:48 86
-rw-r--r--. 1 root root 0 Oct 29 22:48 87
-rw-r--r--. 1 root root 0 Oct 29 22:48 88
-rw-r--r--. 1 root root 0 Oct 29 22:48 89
-rw-r--r--. 1 root root 0 Oct 29 22:48 9
-rw-r--r--. 1 root root 0 Oct 29 22:48 90
-rw-r--r--. 1 root root 0 Oct 29 22:48 91
-rw-r--r--. 1 root root 0 Oct 29 22:48 92
-rw-r--r--. 1 root root 0 Oct 29 22:48 93
-rw-r--r--. 1 root root 0 Oct 29 22:48 94
-rw-r--r--. 1 root root 0 Oct 29 22:48 95
-rw-r--r--. 1 root root 0 Oct 29 22:48 96
-rw-r--r--. 1 root root 0 Oct 29 22:48 97
-rw-r--r--. 1 root root 0 Oct 29 22:48 98
-rw-r--r--. 1 root root 0 Oct 29 22:48 99

6、在test目录下创建一个qimo的目录,在该目录下创建AA-EE的级联目录

[root@localhost test]# mkdir qimo
[root@localhost test]# cd qimo
[root@localhost qimo]# mkdir -p AA/BB/CC/DD/EE


7、打印出ceshi、qimo、kaoshi的路径

[root@localhost ceshi]# tree
.
├── a1
├── a2
├── a3
├── a4
├── a5
├── a6
├── a7
├── a8
├── ac1
├── ac2
├── ac3
├── ac4
├── ac5
├── ac6
├── ac7
├── ac8
├── b1
├── b2
├── b3
├── b4
├── b5
├── b6
├── b7
└── b8

0 directories, 24 files

[root@localhost qimo]# tree
.
└── AA
    └── BB
        └── CC
            └── DD
                └── EE

5 directories, 0 files

[root@localhost kaoshi]# tree
.
├── 1
├── 10
├── 100
├── 11
├── 12
├── 13
├── 14
├── 15
├── 16
├── 17
├── 18
├── 19
├── 2
├── 20
├── 21
├── 22
├── 23
├── 24
├── 25
├── 26
├── 27
├── 28
├── 29
├── 3
├── 30
├── 31
├── 32
├── 33
├── 34
├── 35
├── 36
├── 37
├── 38
├── 39
├── 4
├── 40
├── 41
├── 42
├── 43
├── 44
├── 45
├── 46
├── 47
├── 48
├── 49
├── 5
├── 50
├── 51
├── 52
├── 53
├── 54
├── 55
├── 56
├── 57
├── 58
├── 59
├── 6
├── 60
├── 61
├── 62
├── 63
├── 64
├── 65
├── 66
├── 67
├── 68
├── 69
├── 7
├── 70
├── 71
├── 72
├── 73
├── 74
├── 75
├── 76
├── 77
├── 78
├── 79
├── 8
├── 80
├── 81
├── 82
├── 83
├── 84
├── 85
├── 86
├── 87
├── 88
├── 89
├── 9
├── 90
├── 91
├── 92
├── 93
├── 94
├── 95
├── 96
├── 97
├── 98
└── 99

0 directories, 100 files

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值