Unix directory
Top level
Bin, sbin, home, tmp, libX, usr, var
Home subdirectories
Jane, will, zeb
Will subdirectories
Work, play
Usr subdirectories
Bin, lib
Current working directory /home/will/work
Two files, foo1, foo2 in play directory
1.Using relative path and without changing working directory , display contents of directory play
2. Using relative path and without changing working directory, move foo1 and foo2 from play to lib
3.Using relative path and without changing working directory, get number of lines in Foo (which is in lib now)
4.Using absolute path and without changing working directory, copy Foo back to play, as foo-copy-back
5. Using either, and not changing directory, copy directory play to current directory, as playCopy
6. Next either, move play into Jane, as a subdirectory with same name play
7. Using either, rename directory playCopy as play2
8. Using either, delete directory play from jane
9. Invoke mkdir once, create subdirectory 2031 under current directory, and create lab5 under 2031.
Expert Answer
Relative path is a path in unix which we start from the current directory and go towards the required directory. We never user / at first rather we use ../ in relative path.
Absolute path is the path in unix which we always start from the root directory. We use / at the starting point in absolute path.
The Commands which are required above are below.
1.
2.
3.
4.
5. Using Relative Path
Using Absolute Path
6) Using Relative Path
Using Absolute Path
7) Using Relative Path
Using Absolute Path
8. Using Relative Path
Using Absolute Path
9)