If you can see this check that

           prev section up prev page next page

Soft (symbolic) Link Example

Again, let us assume that the current working directory is /home/john and we wish to create a link 'softfile2' within the subdirectory projects to the file 'softfile'. Notice the '-s' switch:

% date > softfile  ( create the file )

% ls -l 
-rwx-xr-x  1 john users 605 Nov 18 12:25 softfile

% ln -s /home/john/softfile project/softfile2

% ls -l projects/softfile2
lrwx-xr-x  1 john users 605 Nov 18 12:25 softfile2 ->
                 /home/staff/john/softfile

Notice the appended pathname on the long listing, the link number has not changed, but the permissions show an 'l' at the beginning of the long listing rather than a '-'. Again any updates in 'softfile' will be reflected in 'softfile2'. A common symbolic link for programmers is to have a link named 'core' that points to /dev/null. Core files are generated when a program 'core dumps' or produces debugging output. These core files take up a tremendous amount of storage, and are use rarely by anyone. The special file /dev/null is the Unix equivalent of a trashcan. In effect, what you are doing is telling the system to scrap the file whenever an attempt is made to create it.

% ln -s /dev/null core
% ls -l core
lrwx-xr-x  1 john users 9 Nov 18 12:26 core -> /dev/null

With symbolic links you can remove the 'real' file and the symbolic list will still exist.


Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2
Caine 6.0: Essentials | Basic | Search | SysIntro | 5a | 5b | 5c | 6 | 7 | 8a | 8b | WebBrowserA | WebBrowserB | Registry | Browser
Digital Investigation: Editing | Email | Logs | Strength
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo

Copyright @ 2004-2014 Gordon Russell. All rights reserved.