Need help to display the step by step outputs of these questions please. (Linux
ID: 3886675 • Letter: N
Question
Need help to display the step by step outputs of these questions please. (Linux question)
When you give is an argument that is the name of a directory, is displays the contents of that directory. Give an Is command with an argument of the absolute pathname of two (see step 3) to display the contents of the two directory. When you use an absolute pathname, it does not matter which directory is your working directory. Make your home directory the working directory. A relative pathname (Sobell, page 89) is a pathname does not start with a slash, it starts from (is relative to) the working directory. Give an Is command with an argument of two (a relative pathname) to display the contents of the two directory. The rmdir utility removes an empty directory. Show that rmdir cannot remove the two directory while it holds a file. Remove fox from the two directory using a relative pathname and then remove the (empty) two directory.Explanation / Answer
As you didn't specified the path for the directory two, I assume it is located in the home directory.
5. Give an ls command with an argument of the absolute pathname of two, to display the contents
of the two directory.
> ls ~/two/
This command will list all the files in the directory two, which is in the home directory.
6. Make your home directory the working directory.
> cd ~
This will change the pwd to home directory.
Give an ls command with an argument of two to display the contents of the two directory.
>ls two/
This command will list the contents of the two directory.
7. Show that rmdir cannot remove the two directory while it holds a file.
> rmdir two
This command will generate a warning: "Directory not empty" when the directory contains some files in it.
Remove fox from the two directory using a relative pathname and then remove the two directory.
>rm two/fox
This command will remove the file fox from the directory two.
Then issuing the command
>rmdir two
will remove the directory two, as the directory is now empty.