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
1answer
32 views

Why soft links from standard folders?

My observation is, most of the python files sitting in some standard locations like site-packages are symbolic links to actual file name(sitting in non-standard folder) pointing to inode. ...
4
votes
1answer
726 views

python symbolic links (also to itself) in usr/bin

I am currently playing around with cmake a bit and in the process I discovered a few things I don't understand mostly concerning python symbolic links in usr/bin directory: In my usr/bin directory ...
1
vote
1answer
183 views

Link directories in CentOS

I am on a CentOS server and I have a user called theowner, so he has his folder under /home/theowner. I have two other folders, f1 and f2, under /home/myprojects/src, and I want that these folders ...
2
votes
2answers
100 views

What is the benefit of a logical working directory?

I understand what a logical working directory is. When you create a symbolic link to a directory, and then cd to that directory using the symbolic link, your logical working directory becomes the path ...
1
vote
2answers
230 views

Is there any way to create soft link using relative pathname? (not relative to home, or absolute)

I tried using relative to pwd, but it doesn't work. My current pwd is different from target path and original path (from where link need to be created). I do not know the home directory so I ...
1
vote
1answer
828 views

`find -type l` matches file while `-type l -o -type f` does not, but only with explicit `-print` [duplicate]

I'm using GNU's find. I've simplified my problem to this shell session: $ mkdir t $ cd t $ touch a $ ln -s a b $ find -type l ./b $ find -type l -o -type f ./a ./b $ find -type l -print ./b $ find -...
8
votes
1answer
6k views

Can I create a symbolic link to a file I can't access?

[Disclaimer: there's no malicious intent to this question, I'm trying to understand the ln -s command for a school project] Say I have a file system with my home folder, /home/anna. /home/bob is a ...
0
votes
1answer
98 views

Symlink with seperate 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 "user" but in ...
2
votes
1answer
127 views

How do I delete symlinks that's pointing to files in a certain folder?

I think this is best explain with an example: lrwxrwxrwx 1 root root 21 Mar 31 08:44 awk -> /etc/alternatives/awk* -rwxr-xr-x 1 root root 45K Apr 8 2015 b43-fwcutter* lrwxrwxrwx 1 ...
15
votes
2answers
4k views

What idempotent command can I use to make a symlink pointing to a directory?

I want to put a command into a shell script which will create a symlink to directory, but this script could be run over and over, so on subsequent invocations, the command should not change anything. ...
1
vote
1answer
1k views

Nginx symlinks not indexing [closed]

I'm running nginx 1.10.0 on Ubuntu 16.04 Nginx dos not follow symlinks. it even not list the symlink in directory index: as you see in the image wgi is a symlink and it doesn't list in directory ...
8
votes
1answer
414 views

permissions of symlinks inside /tmp

I have 2 users in my machine: linuxlite and otheruser. otheruser has a file: otheruser@linuxlite:~$ ls -l a -rw-rw-r-- 1 otheruser otheruser 6 Mar 31 12:47 a otheruser@linuxlite:~$ cat a hello ...
0
votes
1answer
90 views

Find all softlink files which link to a specific directory use pure find command

I have 2 link directories in ~, ~/PathA (a git directory) and ~/PathB. The ~/PathA is a subdirectory of ~/PathB. Those two are linked to other physical disk. I linked a lot of files to file under ~/...
6
votes
1answer
163 views

Looking for tested utility to get the absolute path to a relative symlink target

NB: In the original title of this post, I used the word standard in the everyday sense of "well-established" (and therefore time-tested, as a contrast to quick solutions I could roll myself). In the ...
7
votes
1answer
295 views

rsync: compare directories with symlinks

There are various similar questions here, but I don't think any of them quite answer this. I have a local directory (www) which has to be mirrored exactly on a remote server, and I need to confirm ...
7
votes
1answer
101 views

What workaround should be used to overcome issue with systemctl refusing to enable unit files that are symlinks?

I have a package that will be updated soon but I know that some of the users will prefer using the old one. That's why I used an update-alternatives routine in the package. The problem is also that ...
0
votes
1answer
521 views

symbolic link to ~/SomeDir relative to user home [duplicate]

I have some project, which I share with other people. It is stored and distributed in git. It should contain links to directories outside the git archive, but inside th user home, where some common ...
3
votes
0answers
90 views

How to approach planning a BSD file server's outward-facing file hierarchy

I'm migrating data on an informal home server to a new FreeNAS (FreeBSD 10) based file server running samba, and I'm stuck in trying to plan how to lay the data out, to give correct access to ...
1
vote
1answer
148 views

How to create a POSIX-compliant relative symbolic link in /bin/sh?

The idea is to have the environment configured like this: mkdir ~/shortcuts cd shortcuts ln -s ../.. up2 As a result I want to be able to go 2 directories up the file tree whenever I call: ~/dev/...
5
votes
2answers
3k views

Size of symlink

Symbolic links do take room, of course, but just the room it takes to store the name and target plus a few bytes for other metadata Do symbolic links actually make a difference in disk usage? My ...
1
vote
0answers
524 views

Symlinks within a mounted cifs is appearing as directories

I have mounted a cifs(samba) share, and noticed that all the symlinks within the share are being shown as directories in the share. I have set unix extensions = no, in Samba. Side note, by setting ...
1
vote
1answer
421 views

Stat Symbolic Link : won't show original file modification time

Stat Symbolic Link stat file it only shows data on when the symbolic link was created. I was hoping to get data on when the origin had been modified.
1
vote
1answer
69 views

Symlink directory with content

So I have /usr as 'ro' filesystem (cannot change that, work rules and security) and I have another directory /bigdata which is 'rw'. I'm installing some services but it needs to write in /usr/foo, so ...
8
votes
1answer
8k views

How to force creation of a symbolic link?

I have a particular directory full of other directories organized (named) by date. For ease of reference, I have a symlink called current pointing to the latest one. In the script that creates new ...
3
votes
2answers
142 views

Giving one file multiple inode values

Is it possible to create a "file" that, essentially, is symlinked to multiple other files. Let's say we have a /tmp/dir/ with 100 files in it. What I want is to be able to do is "cat /tmp/...
1
vote
2answers
137 views

Delete file if symlink is gone

I have tvheadend running on my RPi, and although it stores recordings locally, when the disk gets to 80% full it moves them over to an SSHfs filestore and symlinks to the new location. I'm looking ...
1
vote
1answer
514 views

create symlink with ln but a loop will be created

I would like to create a symlink from my source: /nfs/www/example.com/sourcefolder to this destination: /var/www/example.com/destinationfolder So I run this command: ln -s /nfs/www/example.com/...
36
votes
8answers
6k views

What is the difference between a hard link and a file?

A hard link is defined as a pointer to an inode. A soft link, also known as a symbolic link, is defined as an independent file pointing to another link without the restrictions of hard links. What is ...
4
votes
1answer
3k views

Do hard links really take up so much disk space?

I've found that I need to use hard links with a particular program (Ableton Live) that is unable to see aliases/symlinks, which is of course how I have all my working files organized. But making hard ...
0
votes
1answer
396 views

Execute symlink on different physical drives

I have a folder on my HDD /media/kalenpw/HDD/Documents/ShellScripts that is full of various scripts I would like to have accessible from any directory. My previous strategy was copying all of the ...
1
vote
1answer
144 views

Linking user's home to another disk

I wish to mount a new disk at /disk on my raspberry server. My /home/iago-lito folder and the /root folder are standing on the SD card, which is fine to me. But I would like subsequent new user home ...
2
votes
1answer
799 views

Rsync: Is it possible to transmit src files as symlinks and copying rest of dir structure

I want to copy the src dir as a template i.e. preserving the same structure. The files in this template dir should point to src directory as symlinks. I am not sure if rsync can do this out of box.
1
vote
2answers
51 views

Is there a proper term for a physical path accessed through a symbolic link?

I've spent the last hour deliberating on what to name a property which means the total opposite of "resolved, physical realpath". For example, let's assume /foo/bar/ is an ordinary physical path. If ...
0
votes
1answer
17 views

How to use same directory structure at same time, as two users are logged at same time?

I have a Java EE Web project that stay on ~/git/project directory. This project depends on some relative path configuration made by system vars. Like the var $PROJECT_HOME that is pointed to ~/git/...
1
vote
1answer
143 views

Setting a shortcut's cwd

I have a program that works correctly if: I run it from the command line in its own directory. I run it from the command line from wherever, using cd /path/to/prog && ./prog. I double-click ...
5
votes
2answers
1k views

Symbolic link to change directory only works from home dir

Using this answer, I have created a symbolic link in my .bashrc file to make changing to a frequently used directory easier. E.g. ln -s ~/a/b/c/d/development dev I can change directory from my home ...
1
vote
1answer
1k views

undefined symbol: _ZN5boost15program_options11to_internalERKSs

I' trying to setup mycoin on my digitalocen vps (ubuntu 16 bit 64)and in-counted following error i have search solution for 2 days and nothing resolved this issue boost version : 1.54 Error : /...
2
votes
1answer
323 views

Symbolic link becomes unreadable after prctl(PR_SET_DUMPABLE, 0);

I was debugging kcheckpass under Archlinux. (Because I failed to login with kcheckpass) Somehow I believe this particular problem is not within kcheckpass. int main(int argc, char **argv) { #ifdef ...
3
votes
3answers
176 views

Use awk to send a list of symlinks to files to a directory with spaces in the name?

I have a list of filenames that I want to create soft links to (call it filenames.txt). When using cat filenames.txt | awk 'system("ln -s "$0" ~/directory\ with\ spaces/subdirectory/")` it seems ...
2
votes
1answer
2k views

Symbolic link not working as expected when changes user

Symbolic link not working, using standard UBUNTU 16 LTS... It shows "Permission denied" where I expected to get access, not working even after chown. Full example: sudo rm /tmp/file.txt # if exist, ...
1
vote
1answer
2k views

Symlink and folder permissions

Say I want to create a symlink for a folder /media/drive/here (owned by a group) to a folder /home/pepe/private/here Do all the intermediate folders need to have the x bit on? What does the computer ...
4
votes
2answers
1k views

Why does 'ls -L' print the name of the link itself, not the name of the file that the link points to?

When executing a "long" listing of a soft link, ls -l displays the file attributes of the soft link. When executing ls -lL (or ls -l --dereference), the file attributes are those of the file that the ...
0
votes
1answer
118 views

script to copy, delete and symlink

I want to copy a file to another disk, when completed delete it, and create a symlink back to it in the original location. example: copyandlink.sh somefile.iso #!/bin/bash set -e cp $1 /media/...
2
votes
1answer
278 views

Find of symbolic links point to the same target [duplicate]

How can I find all of the symbolic links in a directory, that point to the same target? For example, here is a list files in a directory: a.txt b.txt a -> target1 c -> target1 m -> target2 ...
1
vote
2answers
159 views

How to create symlinks from file

I have directory scalable for vector icon theme and I have bunch of symlinks in there which I want to replace by a file that contain names that I can use with ln command, I've create the file it ...
1
vote
2answers
330 views

Trace route of a symbolic link

I want to resolve a symbolic link with the additional option to print the whole linkage. For example I want to run a command like readlink -f "symlink2" which reports each entry of the linkage. In ...
14
votes
1answer
3k views

What exactly is dot dot (..)? Why is its behavior different with symlinks?

I am trying to understand the nature of .. (double dot). It seems to point to different targets depending on how you access it. Example:- /outer/ middle/ inner/ inner ...
-1
votes
1answer
118 views

How to take tarball of directories with circular symlinks?

I create a backup by the following command as root (TODO right? because roaima observes that this can cause a complication) in a directory tree which has circular symlinks in some directories; those ...
0
votes
2answers
452 views

Store variable from output bash

Got a bash script to create a backup of some files, it is set in Cron. The bash command, including output, is: [vagrant@localCentOS71 ~]$ sudo create_backup.sh Check if all is good ... done Doing it ...
31
votes
6answers
7k views

Replace file with hard link to /dev/null

I'm running an application that writes to log.txt. The app was updated to a new version, making the supported plugins no longer compatible. It forces an enormous amount of errors into log.txt and does ...