Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Lab Exercise-1

1. Execute the following command and explain the them:


i) mkdir a b c
ANS>>: this will create three directory named a, b,c.
ii) mkdir dir1 dir1/dir2 dir1/dir3
Ans>>: it will first create the dir1 then it will create dir2 and dir3 with in dir1
Like::: dir1

Dir2 dir3
iii) rmdir a b c
Ans>> this will delete directory named a, b,c.
iv) rmdir dir1/dir2 dir1/dir3 dir1
ANS>>>>: it will first delete the dir2 then dir3 then it will delete dir1
Like::: dir1
1
Dir2 dir3
Red Arrows are deleted link.

2. If mkdir test fails, What could be the possible reasons?


3. If rmdir test fails, What could be the possible reasons?
4. Execute ls with following options: - -F, -a, -R, -l, -i.
5. Execute the following:
(1) cp f1 f2
(2) cp f1 os/f2 (os is a directory)
(3) cp f1 os
(4) cp f1 f2 f3 os
(5) cp f* os
6. What is the use of –i option with cp?
7. What is the difference between cat foo and cat > foo? Why do you have to use [Ctrl-d] in one
and not in the other?
8. Execute the following:
(1) mv f1 f2
(2) mv f1 f2 f3 os/
(3) mv os/ unix/ (Does it make any difference if unix/ exists?

You might also like