-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadMe.txt
257 lines (222 loc) · 9.55 KB
/
ReadMe.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
1. No bug.
2.group member name: Shu Pan, Jia Zeng, Lin li.
Jia Zeng and Lin Li mainly implemented Step1 to Step 4.
Shu Pan mainly implemented Step5 to Step 7.
3.
ls command
Situation:root has a directory called dir. In the root/dir, there are two files: image.img; file.txt. They
are both empty.
H:\504C++\lab5-hulukids_lab5\lab5\Debug>lab5.exe
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ls
dir
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ls -l
dir directory size: 19
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ ls -l
image.img image size: 0
file.txt text size: 0
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $
4.
rm command
Situation1:root has a directory called dir. In the root/dir, there are two files: image.img; file.txt. They
are both empty. The file.txt is open.
H:\504C++\lab5-hulukids_lab5\lab5\Debug>lab5.exe
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ rm dir
The directory is non-empty, you cannot remove it.
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ ls
image.img
file.txt
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ cd ..
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ rm dir -r
file.txt is currently in use
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ ls
file.txt
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ ls dir
file.txt
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $
Situation2:root has a directory called dir. In the root/dir, there are two files: image.img; file.txt. They
are both empty and closed.
H:\504C++\lab5-hulukids_lab5\lab5\Debug>lab5.exe
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ rm dir -r
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $ ls
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir $
5
cat command
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch file.txt
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat file.txt
root/file.txt
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
12345
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds file.txt
12345
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat file.txt -a
txt -a
root/file.txt
12345
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
6789
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds file.txt
12345
6789
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat file.txt
root/file.txt
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
oops, I forgot to save
:q
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds file.txt
12345
6789
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat file.txt
root/file.txt
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
overwrite
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds file.txt
overwrite
6.
ds command
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat image.img
root/image.img
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
X X X X X3
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds image.img
X X
X
X X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds image.img -d
fpath : root/image.img
X X X X X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $
7.
cp command
Situation: I created a image.img at root/ and copied it to root/dir1. I modify the copied one, and the original
oene didn't change.
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat image.img
root/image.img
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
X X X X X3
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cp image.img root/dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ls
image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ds image.img
X X
X
X X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ cat image.img
root/dir1/image.img
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
X X2
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ds image.img
X
X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ cd ..
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds image.img
X X
X
X X
8.
sym command
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ touch image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cat image.img
root/image.img
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
X X X X X3
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ sym image.img root/dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ls
image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ds image.img
X X
X
X X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ cat image.img
root/dir1/image.img
Enter data you would like to write to the file. Enter :wq to save the file and exit, enter :q to exit without saving
X X2
:wq
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ cd ..
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ds image.img
X
X
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ rm image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ ls
dir
dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root $ cd dir1
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ls
image.img
To quit: q, For a list of commands: help, For information about a specific command: help <command name>
root/dir1 $ ds image.img
X
X