If you can see this check that
prev section | up | prev page | next page |
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.
Centos 7 intro: | Paths | BasicShell | Search |
Linux tutorials: | intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail |
Caine 10.0: | Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam | |
Caine 13.0: | Essentials | Basic | Search | |
CPD: | Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis |
Kali: | 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 | |
Kali 2020-4: | 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 | |
Useful: | Quiz | Forums | Privacy Policy | Terms and Conditions |
Linuxzoo created by Gordon Russell.
@ Copyright 2004-2024 Edinburgh Napier University