Questions tagged [symlink]

Symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.

symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution

2458 questions
24
votes
2 answers

What is there behind a symbolic link?

How are symbolic links managed internally by UNIX/Linux systems. It is known that a symbolic link may exist even without an actual target file (Dangling link). So what is that which represents a symbolic link internally. In Windows, the answer is a…
Aravind
  • 555
  • 1
  • 3
  • 12
23
votes
6 answers

Laravel - How to revert local storage symlink and refresh

When I save images to storage they show in the storage/app directory, but they don't show in public/storage. I also noticed that a storage/app/public directory seems to have been created which also contains everything within storage/app. I can't…
rushtoni88
  • 4,417
  • 7
  • 22
  • 31
23
votes
2 answers

How to copy a directory with symbolic links and resolve them?

I would like to recursively copy the contents of a directory which contains symbolic links (symlinks) as well as normal files with a Bash / Shell Script. I don’t know how to copy the symlink-contents. The pseudocode would look something like…
Pwdr
  • 3,712
  • 4
  • 28
  • 38
23
votes
2 answers

How to check if a symlink target matches a specific path?

I'm creating a bash script to check if a symlink target matches a specific path so, in case it doesn't match, script removes the symlink. I've tried with readlink: #!/bin/env bash target_path=$HOME/Code/slate/.slate.js if [ `readlink…
Alex Guerrero
  • 2,109
  • 1
  • 19
  • 28
22
votes
2 answers

Python: import symbolic link of a folder

I have a folder A which contains some Python files and __init__.py. If I copy the whole folder A into some other folder B and create there a file with "import A", it works. But now I remove the folder and move in a symbolic link to the original…
Ecir Hana
  • 10,864
  • 13
  • 67
  • 117
22
votes
1 answer

Cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way

The Docker command is not working after restarting (using sudo reboot) the Ubuntu (20.04) server. Now, for any command with docker, it gives me an error. For example, $ docker --help cannot update snap namespace: cannot create symlink in…
Wenuka
  • 887
  • 2
  • 9
  • 25
22
votes
0 answers

With Yarn workspaces, how can compiled binaries be linked to the workspace post-compilation?

Context Yarn workspaces provide for a convenient mono-repo-like functionality where packages are automatically linked. I.e. they can require/import each other, and their binaries are linked and accessible from the workspace root. An…
Tom
  • 8,536
  • 31
  • 133
  • 232
22
votes
3 answers

Getting glob to follow symlinks in Python

Suppose I have a subdirectory of symlinks that looks like the following: subdir/ folder/ readme.txt symlink/ => ../hidden/ hidden/ readme.txt If I run the following code: >>> from pathlib import Path >>>…
bashaus
  • 1,614
  • 1
  • 17
  • 33
22
votes
2 answers

Can I traverse symlinked directories in Ruby with a "**" glob?

In Ruby, Dir.glob("**/*.rb") (for instance) doesn't traverse symlinked directories. Is it possible to get the ** to traverse symlinks? I'm using two gems which find files this way, but I need them to see files within a symlinked directory.
Peeja
  • 13,683
  • 11
  • 58
  • 77
22
votes
1 answer

MAC OSX El Capitan: Airport Sym link not permitted

I tried making a symbolic link to the airport command in MAC OS X El Capitan, using the command: sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport It returned the following…
or3stis
  • 273
  • 1
  • 3
  • 10
22
votes
2 answers

Detecting a symlink in Java

Given a Java 'File' object, how can I detect whether or not it refers to a symlink? (If it helps/matters, I know the file refers to a directory, not to a file)
Matt Sheppard
  • 116,545
  • 46
  • 111
  • 131
21
votes
2 answers

Following a link into a git-repo without lengthy dialog

In a directory I have symbolic links into a git-administered directory (all under Linux). Every time I want to e-dit such a link I get a dialog question: Symbolic link to Git-controlled source file; follow link? (yes or no) And I have to type y e…
false
  • 10,264
  • 13
  • 101
  • 209
20
votes
4 answers

WSL: Using A WSL symlink folder from Windows

I use WSL almost exclusively, and only switch to main windows for browsing and running Windows native programs. I have a git repository located at /mnt/c/myrepo. In order to "install" the code inside /mnt/c/myrepo I need to move it to…
Nathan
  • 463
  • 1
  • 4
  • 9
20
votes
6 answers

How do you make symbolic links work with a remote mount?

I have two servers, A and B A has two filesystems, /alpha and /beta I have a symbolic link: ln -s /alpha/foo /beta/bar Such that: lrwxrwxrwx 1 root root 70 Dec 22 13:32 /beta/bar -> /alpha/foo Next, I mount /beta, remotely on B via an…
Dancrumb
  • 26,597
  • 10
  • 74
  • 130
20
votes
3 answers

PHP opcache reset + symlink-style deployment

I am trying to reset PHP opcache after a symlink-style deployment. There is the opcache_reset.php file in my project which is executing by wget after the document root's symlink replacement:
Vitaly Chirkov
  • 1,692
  • 3
  • 17
  • 33