Some question about symbolic links

I have 1 ssd and 1 hdd in my iMac and symlinked some data folders to my hdd, as was advised to me at the time. Is it possible to recognise in Finder which folders have been symlinked? Or is there a way to recognise them (Terminal command?)


Thanks in advance

Hans

Posted on Jan 5, 2022 2:54 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 5, 2022 3:03 PM

In the Terminal

ls -l /Users/me/tmp

will show if they are symbolic links.

For example

lrwxr-xr-x    1 me staff       33 Jan  5 17:58 this-is-a-symlink -> /Users/me/tmp/tmp.fred.dir

The leading 'l' in lrwxr-xr-x means symbolic link. And the -> points from the symbolic link name to the actual file location


In the Finder a symbolic link will have the same icon as an Alias, which is a small arrow in the lower left corner of the file icon.


You can also use

find /path/to/starting/direcory -type l

to find all the symbolic links. -type l (el) is for symbolic links.

The find command traverses all subdirectories under the starting point, so if you point this at your home directory, it will look at every sub-folder, and sub-sub-folder, etc... starting in your home folder for symbolic links.

2 replies
Question marked as Top-ranking reply

Jan 5, 2022 3:03 PM in response to hanyvo

In the Terminal

ls -l /Users/me/tmp

will show if they are symbolic links.

For example

lrwxr-xr-x    1 me staff       33 Jan  5 17:58 this-is-a-symlink -> /Users/me/tmp/tmp.fred.dir

The leading 'l' in lrwxr-xr-x means symbolic link. And the -> points from the symbolic link name to the actual file location


In the Finder a symbolic link will have the same icon as an Alias, which is a small arrow in the lower left corner of the file icon.


You can also use

find /path/to/starting/direcory -type l

to find all the symbolic links. -type l (el) is for symbolic links.

The find command traverses all subdirectories under the starting point, so if you point this at your home directory, it will look at every sub-folder, and sub-sub-folder, etc... starting in your home folder for symbolic links.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Some question about symbolic links

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.