Problem

In this hands-on project, you make and view links to files and directories. 1. Switch t...

In this hands-on project, you make and view links to files and directories.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type cd samples and press Enter. Next, type ls -F at the command prompt and press Enter. What files do you see? Next, type ls -l at the command prompt and press Enter. What is the link count for the sample1 file?

3. At the command prompt, type ln sample1 hardlinksample and press Enter. Next, type ls -F at the command prompt and press Enter. Does anything in the terminal output indicate that sample1 and hardlinksample are hard-linked? Next, type ls -l at the command prompt and press Enter. Does anything in the terminal output indicate that sample1 and hardlinksample are hard-linked? What is the link count for sample1 and hardlinksample? Next, type ls -li at the command prompt and press Enter to view the inode numbers of each file. Do the two hard-linked files have the same inode number?

4. At the command prompt, type ln sample1 hardlinksample2 and press Enter. Next, type ls -l at the command prompt and press Enter. What is the link count for the files sample1, hardlinksample, and hardlinksample2? Why?

5. At the command prompt, type vi sample1 and press Enter. Enter a sentence of your choice into the vi editor, then save your document and quit the vi editor.

6. At the command prompt, type cat sample1 and press Enter. Next, type cat hardlinksample at the command prompt and press Enter. Next, type cat hardlinksample2 at the command prompt and press Enter. Are the contents of each file the same? Why?

7. At the command prompt, type ln –s sample2 symlinksample and press Enter. Next, type ls -F at the command prompt and press Enter. Does anything in the terminal output indicate that sample2 and symlinksample are symbolically linked? Which file is the target file? Next, type ls -l at the command prompt and press Enter. Does anything in the terminal output indicate that sample2 and symlinksample are symbolically linked? Next, type ls -li at the command prompt and press Enter to view the inode numbers of each file. Do the two symbolically linked files have the same inode number?

8. At the command prompt, type vi symlinksample and press Enter. Enter a sentence of your choice into the vi editor, then save your document and quit the vi editor.

9. At the command prompt, type ls -l and press Enter. What is the size of the symlinksample file compared to sample2? Why? Next, type cat sample2 at the command prompt and press Enter. What are the contents and why?

10. At the command prompt, type ln –s /etc/sysconfig/network-scripts netscripts and press Enter. Next, type ls -F at the command prompt and press Enter. What file type is indicated for netscripts? Next, type cd netscripts at the command prompt and press Enter. Type pwd at the command prompt and press Enter to view your current directory. What is your current directory? Next, type ls -F at the command prompt and press Enter.What files are listed? Next, type ls -F /etc/sysconfig/network-scripts at the command prompt and press Enter. Note that your netscripts directory is merely a pointer to the /etc/sysconfig/networkscripts directory. How can this type of linking be useful?

11. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search