Return to Level1Techs.com

Symbolic Links - Whats yours

Does any of the Linux users here use symbolic links? What are your use cases?

I’m interested in using it for a desktop and server application.

Kinda like for shortcuts under Windows. Like I symlink the daily Blender 2.83 Beta build directory to blender-2.83-beta-linux64 so my background render scripts dont have to be edited all the time.

isn’t it more powerful then that? isn’t it similar to pathing a directory?

IDK? I think you can use shortcuts for folders too? I don’t get to fancy with linking stuff around cuz it’s easy to make a mess of things… :smiley:

You can. It’s very useful.

I use it for my webserver (nginx) config files.

Here’s an example off one of my Linux development workstations. All the lines with -> are symlinks.

$ ls -l ~/.local/bin
total 36
drwxr-xr-x 7 zlynx zlynx 4096 Apr 20 13:16 android-studio
-rwxrwxr-x 1 zlynx zlynx 4268 Jul 13  2019 buddyinfo.py
lrwxrwxrwx 1 zlynx zlynx   23 Aug 19  2019 clang-format -> /usr/bin/clang-format-8
lrwxrwxrwx 1 zlynx zlynx   27 Aug 19  2019 git-clang-format -> /usr/bin/git-clang-format-8
lrwxrwxrwx 1 zlynx zlynx   42 Jun 22  2016 gorilla -> zdia-gorilla-modified//sources/gorilla.tcl
lrwxrwxrwx 1 zlynx zlynx   45 Aug  6  2019 gradle -> android-studio/gradle/gradle-5.1.1/bin/gradle
-rwxr-xr-x 1 zlynx zlynx  118 Feb 19 17:17 my-ninja
-rwxrwxr-x 1 zlynx zlynx  123 Feb 25 18:49 my-ninja-and-test
-rwx--x--x 1 zlynx zlynx  513 Mar 31 11:46 randbg
-rwxrwxr-x 1 zlynx zlynx  187 Mar 31 11:48 rsync-wallpaper
lrwxrwxrwx 1 zlynx zlynx   28 Jul 13  2019 studio.sh -> android-studio/bin/studio.sh
drwxrwxr-x 5 zlynx zlynx 4096 Jun 22  2016 zdia-gorilla-dac1d37
drwxrwxr-x 7 zlynx zlynx 4096 Jun 22  2016 zdia-gorilla-modified

Yeah, idk if I’d go looking for a reason to use one, but any time you want something in more than one place, ln -s

1 Like

It’s mostly useful for developers as they can symlink a .bin folder to their local path to test local binaries.

I’ve heard somone use it for game saves across multiple devices. I was wondering if it was worth using the symbolic linking to path a storage drive to the /home folder

Do you want to mount the whole drive as home? That’s a common thing to do, but doesn’t involve a symlink.

No. Maybe a folder or two. Years ago i saw a post on another forum where someone symbolicly linked the regular folders to a folders on a secondary drive (1-1).

Or people tracking dotfiles in a git repo

Uh, that’s not how a symlink works. A link isn’t a copy, it’s a shortcut, so you don’t get a backup from it.

I’ve got my ~/Music pointed at my array, but that means my /home partition has no /$USER/Music directory.

Isnt this the along the lines of hard and softlinks?

Are there any cool and nifty ways to do symlinks for the average desktop linux user? I guess savegame management is a thing I could do. Can I move savegames in a custom directory, like say in a NAS, then drop back a symlink from where I got save files from?

Symlinks are awesome!

First big usecase of mine that comes to mind, is stow - which I use to handle my dotfiles.

I have a simple Git repository, config, that I store all my configurations on (e.g. I have config/ansible and config/dotfiles) - I just quickly

cd ~/config/dotfiles
stow git -t ~

and I’m up and running.

2 Likes