Experiments with symbolic links in unix


How to create a symbolic link from one file to another

To create a symbolic link from

	fileA -> fileB
	
enter the following commands... (note, this example assumes fileB doesn't exist yet... if it does, simply skip the first command).
	touch fileB	
	ln -s fileB fileA
	

How to create a symbolic link from one directory to another

To create a symbolic link from

	dirA -> dirB
	
enter the following commands... (note, this example assumes dirB doesn't exist yet... if it does, simply skip the first command)
	mkdir dirB
	ln -s dirB dirA
	

Breaking a symbolic link

To break a symbolic link of

	fileA -> fileB
	
use
	rm fileA
	
Note: fileB will remain untouched.

To break a symbolic link of

	dirA -> dirB
	
use
	rm -rf dirA
	
Note: dirB will remain completely untouched.

Related Notes: