Questions tagged [symlink]

A special type of file that references an inexistent or existing file or directory. The contents of a symbolic link consist of an arbitrary string that is the path to the file that the symbolic link points to. When the symlink is encountered during pathname resolution, the string stored by the file is used to modify the pathname resolution.

Filter by
Sorted by
Tagged with
0
votes
0answers
40 views

how do I undelete my Python3 symlink to Python3.8?

I've run into an issue where I've lost the ability to use apt on my Debian: I get "No module named 'apt_pkg'" despite uninstalling it and reinstalling it. Another person while looking at the ...
3
votes
0answers
43 views

What could cause EROFS error for an openat call of a symlinked path, but only sometimes?

I'm trying to debug an issue which I see only intermittently, often only once or twice per server and then it goes away. I have an application which attempts to open a lock file using openat() with ...
-1
votes
1answer
20 views

MacOS type of aliases to file

I know how to create symlinks in linux (Raspberry Pi OS), but i try find a way to create MacOS type of aliases which point to file or folder.
2
votes
1answer
33 views

Symlinks in a path pointing to another drive block `ls`

I recently took out some specific directories from my /home directory and put them on an external hard drive that is mounted on another path (/mnt). Inside my home directory I have created symlinks to ...
0
votes
1answer
49 views

Why . and .. are hard links to directories while in *nix systems hard links are not allowed for directories?

I know how hard links and symlinks work and I know why hard links can't be used for directories but in this case, is it some kind of exception? For example I do: ls -al Documents total 8 drwxr-xr-x ...
0
votes
0answers
55 views

Fix too many levels of symbolic links. Linux from scratch

I was trying to follow the Linux from scratch book but I'm having trouble compiling glibc, I think this is related to the problem I'm having with the tools directory. On one part of the book, I was ...
0
votes
0answers
17 views

Prevent a symlink to root directory from being unmounted

I have a symlink etablished under /mnt/ like so ln -s / /mnt/$(HOSTNAME). This is so that I can easily access multiple nfs mounted disks, including the host machine itself. But recently a colleague ...
2
votes
2answers
4k views

Can Symbolic Links span different file systems in Unix or Linux

Can Symbolic Links span different file systems in Unix or Linux ??? I.e consider different file systems like ext2 and ext3 can symbolic link span them?
0
votes
1answer
17 views

Automated file backups/copies that are not symlinks

I have 2 directories: /home/Documents/oppo/ /home/Backup/oppo/ If I wanted to manually copy the contents over, I would do: rsync -av /home/Documents/oppo/ /home/Backup/oppo/ But I am actually ...
1
vote
2answers
118 views

Virtualbox shared folders with symlinks

I want to configure 1 shared folder /home/host/shared and put symlinks to other shared items in that shared directory to make them accessible by the guest machine like /home/host/shared/d1 --> /...
346
votes
11answers
207k views

How can I find broken symlinks

Is there a way to find all symbolic links that don't point anywere? find ./ -type l will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. ...
0
votes
1answer
185 views

Symlink with separate permissions on either side

How can I create a symlink that works kinda like this: There is a symlink in /home/user/ called www I want to make it so, "user" can go into the symlink, and everything be owned by "...
1
vote
1answer
37 views

cp vs. cp -r on symlinks

I recently experimented with the cp command, and noticed the following: Lets assume we have a folder foo, containing the file bar and the symbolic link l-bar: foo |-- bar |-- lbar -> bar When ...
2
votes
1answer
4k views

Samba does not show symlinks

I am using samba under ubuntu 14.04 and I try to share a folder which includes a symlink to a directory that lies on an external drive. If I access the samba share from other devices (like android ...
1
vote
2answers
6k views

Python symbolic links mixed up

Using Ubuntu 16.04 Tried to set python 3.6 as default for the python3 command. I found what seemed to be the answer and quickly copy-pasted the following lines without carefully reading: $ sudo ...
0
votes
0answers
25 views

emulate windows path with symbolic links

I have many files that refer to N:/path/to/MainFolder I am working with Ubuntu, I do not use Windows and I have my MainFolder in my user directory. I would like to know if there is a way to create a ...
0
votes
0answers
10 views

Prevent string splitting in argument to readlink [duplicate]

I am writing a small script to symbolically link configuration files from my dotfiles directory to another one. I do not have control over the file names and unfortunately one of them is causing me a ...
1
vote
0answers
31 views

Resolving paths (with absolute symlinks) against a base prefix

Consider we mount a foreign directory tree under some location and then chroot into it: mount /dev/sdx1 /mnt chroot /mnt readlink /usr/bin/myapp # Outputs: /usr/libexec/myapp/run Is there any tool ...
1
vote
1answer
106 views

Updatedb include the path pointed by symbolic link

I have created mlocate database with the contents of a particular folder. I see that the updatebd doesn't include the path pointed by the symbolic links in the database. How can I include the path ...
97
votes
3answers
129k views

How to change ownership of symbolic links?

I am facing some issue with creating soft links. Following is the original file. $ ls -l /etc/init.d/jboss -rwxr-xr-x 1 askar admin 4972 Mar 11 2014 /etc/init.d/jboss Link creation is failing with ...
0
votes
0answers
19 views

Link using SSH ln -S Symlink or alternitive to external server

im looking for the option to link to my synology for the space external from my web server i tried web dav and Symlinks but cant find a way to link a folder to my synology system. is there a way to do ...
17
votes
2answers
21k views

Does Windows recognize Linux's symbolic links?

I was just wondering how a Windows system handles symbolic links (when created via Linux's ln -s on a filesystem that Windows natively supports and that supports symbolic links, such as NTFS). My best ...
28
votes
3answers
13k views

How does the /proc/<pid>/exe symlink differ from ordinary symlinks?

If I start a process and then delete the binary of it, I can still recover it from /proc/<pid>/exe: $ cp `which sleep` . $ ./sleep 10m & [1] 13728 $ rm sleep $ readlink /proc/13728/exe ...
1
vote
0answers
9 views

Symlink to file in /proc [duplicate]

I was looking at some different files in /proc, and observed some strange behavior. So, first of all, we know that symlinks [point to names, not files][1]. And when creating a symlink, I can both ...
0
votes
0answers
24 views

Symlinking to / [duplicate]

I'm working on a little project that makes installing from source easier and one of those parts is getting the project to compile to a certain directory /usr/src/pkgname, so that all the files in ...
1
vote
1answer
126 views

How to confirm if pathname exists?

How do I test whether a pathname exists? Previously I was using: realpath -e /some/path Which works except if /some/path is a broken symlink, in which case it reports that it does not exist. [ -e /...
0
votes
1answer
20 views

Double symlink of vim doesnt load library file ncurses.so.6 when invoked with sudo

I have a symlink of the vim.basic executable: ⤷ ls -l /etc/alternatives/vim lrwxrwxrwx 1 root root 18 Apr 22 21:02 /etc/alternatives/vim -> /usr/bin/vim.basic Another symlink to the above symlink ...
5
votes
2answers
2k views

Accidentally created symbolic link to a folder in that folder

I was creating a symbolic link to folder1/folder2 in home-folder. But I accidentally did: ln -s folder1/folder2 while in folder2 instead of in home-folder. So I ended up accidentally creating a ...
2
votes
1answer
2k views

How to make $ORIGIN in RPATH not follow symlinks?

I have an executable app, which depends on a library libbar.so and loads it via RPATH with $ORIGIN like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type ...
0
votes
0answers
26 views

Symlink to python exec and the python exec have different sys paths. This causes ModuleNotFoundError

My project structure is : $ tree . -L 2 . ├── venv │ ├── bin │ ├── include │ ├── lib │ ├── lib64 -> lib │ ├── pip-selfcheck.json │ └── pyvenv.cfg ├── py -> /path/to/project/venv/bin/...
0
votes
1answer
69 views

Linking a dropbox business acccount from “~/Dropbox (firm-name)” to “~/Dropbox”, with “mount --bind” or symlink or something else?

Been using my Dropbox account for years on a Lubuntu system. Now, my new company has made a Business account available to me. However, Dropbox insists that this folder should be called: ~/Dropbox (...
0
votes
1answer
19 views

Can I use locate's functionality to find symlinks faster?

I've just read: How to find all symbolic links pointing to any file/directory inside a given directory but that is pretty slow. Now, on typical Linux systems, a filesystem database-of-sorts is ...
6
votes
1answer
2k views

Debian: How to resolve relocation error?

I am running Debian 7.1. I tried to apt-get install -f, and messed up. All command line returns ln: relocation error: /lib/arm-linux-gnueabihf/libc.so.6: symbol _dl_find_dso_for_object, version ...
122
votes
10answers
216k views

How to get full path of original file of a soft symbolic link?

I want to scp a file to a server. The file is a symbolic link, and actually what I want to do is copy the source file. I don't want to track the source file's path manually, because it can be replaced....
1
vote
1answer
3k views

Is it possible to make a symbolic link of a file in other machine?

I have a account in a server and I would like have a symbolic link of some files in my local machine. How can I do this?
0
votes
2answers
44 views

How to copy target files using symlinks and a list of file names

I would like to copy many files. I have their location as a set of symbolic links whose names are stored as lines in a txt file. So I am using cp and need to combine the readlink and cat/pipe ...
0
votes
1answer
47 views

What is deleting my symlink to my USB luks partition upon cryptsetup luksOpen?

I wrote a new udev rule to create a symlink to a luks-encrypted partition on a USB flash drive when the drive is plugged in. The new udev rule I wrote does create the symlink to the USB drive's ...
0
votes
2answers
53 views

Creating symbolic link in the same directory

Having some trouble with creating links. I want to create the following: ls -la /usr/pkgs/python3/ total 44 drwxr-xr-x 5 root root 4096 Sep 3 2020 . drwxrwxr-x 259 root root 20480 Feb 16 06:49 .. ...
26
votes
8answers
37k views

How to copy a folder structure and make symbolic links to files?

I have a folder SOURCE that contains several sub-level folders, each with its own files. I want to copy this folder in a new folder COPY where I need to copy the directory structure but keep the ...
20
votes
2answers
10k views

sshfs breaks symlinks from SFTP server

Does anyone know how to mount a remote SFTP path via SSHFS so that you can work with symlinks? When I do this, all the symlinks I create point to the wrong files (not the ones I linked to.) All the ...
0
votes
2answers
71 views

Can symlinks be used to point to a remote file that may not be available

I'm looking for a smart way to manage a pi I use for downloading with omv5, dockstarter, docker, etc... My pi can be on all the time, but the larger server I'd like a schedule, so the pi will use wol ...
66
votes
6answers
92k views

Determining if a file is a hard link or symbolic link?

I'm creating a shell script that would take a filename/path to a file and determine if the file is a symbolic link or a hard link. The only thing is, I don't know how to see if they are a hard link. ...
2
votes
0answers
443 views

Absolute path to current user's home directory without using bash expansions?

This is a problem that crops up from time to time and annoys me greatly. Sometimes I need to provide an absolute path, normally in a configuration file, that should refer to the current user's home ...
30
votes
6answers
19k views

Getting relative links between two paths

Say I have two paths: <source_path> and <target_path>. I would like my shell (zsh) to automatically find out if there is a way to represent <target_path> from <source_path> as ...
0
votes
0answers
18 views

Symbolic link renaming backup files

I'm using backup files for when I create new symbolic link for files/folder. Because it's renaming existing symbolic files automatically on target folder like this : Let's say /home/main/Desktop is ...
1
vote
2answers
2k views

Preserve file permissions and symlinks in archive with 7-Zip

I have a directory test with three files, ls -l test: total 8 -rw-r--r-- 1 mb mb 16 Jul 25 11:12 regular_file -rwxr-xr-x 1 mb mb 19 Jul 25 11:02 script.sh lrwxrwxrwx 1 mb mb 12 Jul 25 11:14 symlink -&...
1
vote
0answers
13 views

Problem to follow links in Samba

To get acquainted with Samba I installed it on a Raspberri Pi and and tried to access shares from Windows (7). Everything works so far, except when I try to get more space by mounting an external ...
20
votes
6answers
10k views

Is there an algorithm to decide if a symlink loops?

Unix systems usually just error out if they are confronted with a path that contains a symlink loop or just too many symlinks, because they have a limit to the number of symlinks they will traverse in ...
1
vote
2answers
63 views

How to tell a program it's in a symlink folder?

If I have a symlink folder like: /home/user/foo/foo2 -> /home/user/bar/bar2 I cd to: /home/user/foo/foo2. If I do a pwd, it returns: /home/user/foo/foo2. Great! But if I then ls ../ it will return ...
21
votes
6answers
56k views

How to copy symlinks as symlinks from one machine to another?

Let's assume I have two identical systems. On the first system I've created a symbolic link. On the second one I want to copy that symlink via sftp and the symlink shall work the same (i.e if the ...

1
2 3 4 5
21