Lab #4

Link Files & Working with the BASH Shell

Objective

 

To understand link files and to get a better understanding of how the BASH shell works.

 

Reading

 

In "Linux+ Guide to Linux Certification", please review:

·          Chapter 4 ("Linux File System Management")

·          Chapter 7 ("Working with the BASH Shell")

·          My Notes

 

 

 

Q1. Complete Project 7-1 and report on what you did and found.

 

Q2. Complete Project 7-2 and report on what you did and found.

 

Q3. Complete Project 7-3 and report on what you did and found. In part 6, if you don’t find a .bash_profile file, please create an empty one and then do part 6.

 

Q4. Complete Discovery Exercise 1 on page 343 and report on what you did and found.

 

Q5.   Assume that the following files exist in the current directory. (you are jonesd)

bash$ ls -li
total 1
32845 -rw-r--r-- 2 jonesd users 0 Apr 6 15:38 file1
32845 -rw-r--r-- 2 jonesd users 0 Apr 6 15:38 file2
32847 lrwxr-xr-x 1 jonesd users 10 Apr 6 15:38 myfile -> file1

 

For each of the following commands explain how the output of the command ls -li will change AFTER the command has been executed. Assume that that each command starts with the above information

For example, after the command

mv  file1  CQ.DOC

the only change would be that entry for the file file1would change to

32845 -rw-r--r-- 2 jonesd users 0 Apr 6 15:38 CQ.DOC

 

 

1.     chmod a-x myfile

2.     chmod 770 file2

3.     rm file2

4.     rm file1  

5.     The files file1and file2 both point to the same file using a hard link. Above I have stated that if you execute the command mv file1 CQ.DOC the only thing that changes is the name of the file file1. Why doesn't the name of the file file2 change also?