Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1
vote
0answers
23 views

How to list the contents of a directory using a symbolic link?

I'm trying to figure out how to list the contents of a directory using a symbolic link to that directory. I read the answers here - Show contents of symbolic link The problem I'm having is just that ...
0
votes
0answers
16 views

Symbolic links in Yocto

I'm trying to make a sym link in Yocto to enable a systemd service that is not enabled by default (apache2, by the way). Here my post process command: my_postprocess_function() { ln -s ${...
0
votes
1answer
13 views

Canonical path without resolve symbol link

I have a symlink file like this, cd /tmp ln -s /bin/ls /test Now I would like to resolve ../test to /test, but readlink command also resolves the symbol link for me, e.g readlink -f ../test ../test ...
2
votes
2answers
51 views

Link which receives updates and original folder doesn't

Is it possible to have a link to origin When user try to update the original folder, all link folders will receive the new files, but any change to the files will not be in the original. The user ...
6
votes
1answer
485 views

Can I create a one way symlink?

I want to create a one way symlink i.e. I can use it to go to the destination directory but I cannot go back. Let's say there is a directory called D with two subdirectories S1 and S2. I want to ...
284
votes
10answers
161k 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
2answers
29 views

Permission through symbolic link

The user (33) is not able to read the web.{crt,key} files. Do I have to give permission all through the links or is there a clever way to do this? # ll /mnt/efs/cert total 20 -rw-r--r-- 1 33 tape ...
1
vote
2answers
23 views

Symlinked directories and output redirect

When I run the following command, where symlinked-dir is just that - a symlink to another directory, cat complains that there is no such file. There is, indeed, no such file - it's created in the ...
0
votes
1answer
34 views

How to set PATH to symlinked directory in bash csh

I have the directory /data/bin and in my home directory is symlink /home/myuser/bin -> /data/bin I have set PATH into the /home/myuser/bin/ When /home/myuser/bin is the directory, the PATH works fine,...
4
votes
1answer
4k views

Enable systemd services without systemctl

I need to enable systemd services before I'm actually booting the system (for unattended install purposes). Therefore I can't use systemctl. I could use systemd-nspawn, but I think it not that well ...
0
votes
0answers
17 views

sysfs folder symbolic link behavior

I encountered this behavior that I can't explain. In the sysfs, there is a symbolic link but it looks impossible to me: me@test:/sys/block/sde$ ll ... lrwxrwxrwx 1 root root 0 Oct 1 2019 device -...
0
votes
2answers
51 views

Symlink not working

I have two folders, /test/opt and /test2/opt. I want to create a symbolic link so that when application will write something to /test/opt it will go to /test2/opt. I tried creating a symlink using ...
19
votes
5answers
36k views

Finding the original file of a symbolic link

So let's say I have a symbolic link of a file in my home directory to another file on a different partition. How would I find the target location of the linked file? By this, I mean, let's say I have ...
64
votes
14answers
4k views

Tips for remembering the order of parameters for ln?

I have used ln to write symbolic links for years but I still get the order of parameters the wrong away around. This usually has me writing: ln -s a b and then looking at the output to remind ...
8
votes
2answers
24k views

How to find out a file is hard link or symlink? [duplicate]

I have a file in ~/file.txt. I have created a hard link by : ln ~/file.txt ~/test/hardfile.txt and a symlink file : ln -s ~/file.txt ~/test/symfile.txt Now, How can I find out that which file is ...
1
vote
3answers
62 views

Hardlink that “split” when a file changes

Is it possible (in classical ext4, and/or in any other filesystem) to create two files that point to the same content, such that if one file is modified, the content is duplicated and the two files ...
0
votes
1answer
37 views

When writing a tool named “foo”, why symlink PROJECT/bin/foo to ../libexec/foo

I've been learning bash and unix by reading source code. This particular bit I don't understand why it was done. The main tool executable is a symbolic link. Whats the benefit here? source
2
votes
1answer
48 views

Realtek Firmware Installation Error

Im working on an odroid HC2, which runs Debian 9 "Stretch". In my logs, I can see that there is a driver missing for Wifi: usb 1-1: request_firmware(rtlwifi/rtl8192eu_nic.bin) failed So i ...
-1
votes
1answer
28 views

How do I use a script that contains paths to other files regardless of its location?

I have a script stored in a particular directory nested deep within other directories. a/long/path/to/the/script.sh I created a hard link to the script from my desktop, so it might be easier to ...
5
votes
3answers
4k views

OpenSSH refused .ssh directory with a symbolic link

In my environment, actual .ssh directory exists on external device and links from it to ~/.ssh with a symbolic link. Using openssh as client is working without problem, but sshd does not allow to ...
0
votes
1answer
15 views

Link different CIFS mounts of different users to the same location

Many users on the client each have personal CIFS password-protected mounts to the server in their respective home folder. E.g., /home/user1/server/share1 (mounted with credentials for user1) /home/...
26
votes
4answers
25k views

ln -s with a path relative to pwd

I'm trying to create a bunch of symbolic links, but I can't figure out why this is working ln -s /Users/niels/something/foo ~/bin/foo_link while this cd /Users/niels/something ln -s foo ~/bin/...
1
vote
0answers
38 views

Can we change permissions on a symbolic link? [duplicate]

on a course exercice they ask me to change permissions on a symbolic link , but i try chmod but they didn't work , and after i search on internet but i didn't see a request for my questions. Do you ...
2
votes
1answer
5k views

How to solve - Failed to execute operation: Too many levels of symbolic links on CentOs 7

I am trying to install erpNext on a CentOS 7.4 VPS and I'm following the installation script here. But I get this error during installation: Processing dependencies for pip Finished processing ...
3
votes
1answer
15k views

Why can't I copy symbolic links?

I'm trying to copy one directory to an ext4 filesystem on a Veracrypt encrypted USB stick. The command I used was: cp -aL /source /destination I've also tried: cp -ad /source /destination ... but ...
0
votes
0answers
26 views

Cannot rm broken NTFS link

I'm trying to use an old windows NTFS drive as extra storage on a raspberry pi. I tried to delete everything on it, but came across a problem where I can't remove two broken links. I can format the ...
0
votes
0answers
11 views

BSD tar xPf won't extract hardlinked files through symlinked directory

On MacOS 10.11.6, /usr/bin/tar is "bsdtar 2.8.3 - libarchive 2.8.3". The -P option allows me to extract a tar file through a symlink. That is, if foo1 is a symlink to foo2, and the tar file stores ...
1
vote
0answers
41 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 ...
0
votes
0answers
53 views

Symlink not executing PHP script below web root

I'm quite new to server admin and I've run into a problem while trying to create a symlink which points to a PHP script below the web root. Command: cd /home/myuser/public_html ln -s ../myphp.php ...
2
votes
1answer
42 views

Symlink to a bash script unable to “see” an alias

I'm having some difficulty understanding a subtlety of how a bash script works with arguments when it's accessed via a symbolic link. The issue is most easily explained with commands and their output: ...
0
votes
3answers
35 views

Uncertainty with Symlinks

I've done a quick search but I can't find anything specific about this scenario: Let's say I have a directory (let's ignore the path) and call it A. Now, I create a symlink to directory A called S. ...
1
vote
0answers
44 views

Linux create symlink on slow drive to tmpfs

My application creates cache for read/write inside my OS drive, which is slow, so I have mounted tmpfs and created a directory inside it. Then I created a symlink at the path on the slow drive where ...
3
votes
3answers
416 views

Symlink to directory for easy access: .bashrc, usr/local/bin, something else?

(Mint 19.1, based on Ubuntu 18.04) I have a directory I frequently access but which has a long path. I am tired of typing it out, so I want to be able to easily jump to this directory. The simplest ...
3
votes
3answers
133 views

Recursively “find” file names containing string and symlink files in another directory

I am trying to symlink a set of specific files from a project I'm working on. There is a known string in each of the filenames I wish to symlink. Here is what I have so far: ln -s find ~/path/to/...
1
vote
1answer
49 views

How to check the timestamp of a symbolic link?

Is there a way to use traditional commands to update a symlink when it's older than the original file? I use a Seafile server (similar to Dropbox) to make certain files available to my students. So I ...
0
votes
2answers
292 views

Symlinking /mnt in a VM to compile file directly to VM folder

What I'm trying to do is symlinking a shared folder between my Mac and my Ubuntu VM. The shared folders on the VM are going in /mnt/hgfs/. On my Mac I symlink the directory (let's say macdirectory) ...
7
votes
2answers
21k views

How to create a shortcut to a folder to Documents

I have a folder in /media/sf_fedora which I want to access from Documents instead of going into /media each time, how can I create a shortcut. The 'Make Link' is grayed out in the Edit menu for some ...
0
votes
1answer
35 views

How to create a symlink the desktop way in debian Xfce?

The method of using ctrl + shift and clicking on the item in the file manager does not work. Is there another method to achieve the creation of a symlink from the desktop? thanks for any hint
5
votes
1answer
937 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 ...
1
vote
1answer
44 views

How to remove soft link to directory?

[murphy@eva02 playg]$ ls -l total 12 drwxrwxr-x. 2 murphy murphy 4096 Jul 22 14:02 dir1 lrwxrwxrwx. 1 murphy murphy 4 Jul 22 14:03 dir1-sym -> dir1 drwxrwxr-x. 2 murphy murphy 4096 Jul 22 14:02 ...
2
votes
1answer
1k 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 ...
1
vote
2answers
1k views

Puppy Linux Live CD: “Symbolic Link to Unsupported Reparse Point”

Here are a few specs: Windows 10 Pro Slacko Puppy 6.3 700 MB CD 16 GB RAM 2 TB HDD Currently, to do some testing, I am running Puppy Linux from a live CD and attempting to access the files on my ...
1
vote
1answer
1k 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?
130
votes
8answers
54k views

Why are hard links to directories not allowed in UNIX/Linux?

I read in text books that Unix/Linux doesn't allow hard links to directories but does allow soft links. Is it because, when we have cycles and if we create hard links, and after some time we delete ...
11
votes
5answers
34k 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 ...
0
votes
1answer
19 views

Symlink on remote file server to refer to file on local machine over sshfs

I have an sshfs mount to my file server. In the mounted directory there is a symlink that points to /tmp/localfile. /tmp/localfile does not exist on the remote server, but does exist on the local ...
0
votes
1answer
31 views

Recursive Symbolic links

I want to drop through my mp3 folders and create a sym link to each mp3 in a folder called links. I would like for my links to be relative to the directory structure rather than absolute. I tried this ...
1
vote
2answers
51 views

What sort of file thing do 'namespace files' point to?

I was poking around /proc/*/ns, and noticed that namespace files look unfamiliar: # example from `man namespaces` $ ls -l /proc/$$/ns total 0 lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 cgroup -> cgroup:[...
10
votes
1answer
2k views

Can GNU Stow use a stow directory that is a symbolic link?

Consider this script. #! /usr/bin/env bash mkdir -p target mkdir -p mydir/package/ touch mydir/package/file ln --symbolic mydir mylink file mylink stow --verbose --dir=./mylink --target=./target ...
1
vote
1answer
24 views

Linux: synchronize directories via symlinks

I have two directories, say A/ and B/, each with their own subtree. I'd need to synchronize the content of A/ with the content of B/. The result I need is similar to recursively copying the subtree ...