In an OS X terminal session, if I do a ls -l I saw several of that listing. What does -> ./yyyy tell me about the xxxx file?
xxxx -> ./yyyy
That means that the xxxx file is a symlink to the ./yyyy file. A symlink is basically an alias or shortcut to the source file (./yyyy here). This has a decent explanation of symlinks and how to use them:
Symbolic Links are an older feature that harken back to the BSD roots of Mac OS X. These files simply contain the path of the target file or directory stored as text. If you move the target file, the symlink will break because it still points to the original location in the link. However, symlinks work at a low-level such that almost all applications and OS features will follow them to the target.
It means that the file is a symbolic link. For example /etc
is a symlink to private/etc
and /tmp
is a symlink to private/tmp
.
$ cd /
$ ls -l
total 16437
drwxrwxr-x+ 157 root admin 5338 Feb 23 16:11 Applications
drwxr-xr-x+ 67 root wheel 2278 Feb 23 14:31 Library
drwxr-xr-x@ 2 root wheel 68 Aug 25 2013 Network
drwxr-xr-x+ 5 root wheel 170 Feb 23 15:34 System
drwxr-xr-x 7 root admin 238 Feb 23 14:42 Users
drwxrwxrwt@ 3 root admin 102 Feb 23 16:00 Volumes
drwxr-xr-x@ 39 root wheel 1326 Jan 29 11:44 bin
drwxrwxr-t@ 2 root admin 68 Aug 25 2013 cores
dr-xr-xr-x 3 root wheel 4434 Feb 22 23:12 dev
lrwxr-xr-x@ 1 root wheel 11 Jan 29 11:37 etc -> private/etc
dr-xr-xr-x 2 root wheel 1 Feb 23 16:27 home
-rwxr-xr-x@ 1 root wheel 8393256 Sep 20 08:22 mach_kernel
dr-xr-xr-x 2 root wheel 1 Feb 23 16:27 net
drwxr-xr-x 4 root wheel 136 Feb 23 14:31 opt
drwxr-xr-x@ 7 root wheel 238 Feb 23 14:31 private
drwxr-xr-x@ 62 root wheel 2108 Jan 29 11:45 sbin
lrwxr-xr-x@ 1 root wheel 11 Jan 29 11:37 tmp -> private/tmp
drwxr-xr-x@ 15 root wheel 510 Feb 23 15:40 usr
lrwxr-xr-x@ 1 root wheel 11 Jan 29 11:37 var -> private/var
You can also see the target of a symlink with readlink
or stat -f%Y
:
$ readlink /etc
private/etc
$ stat -f%Y /etc
private/etc