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
3
votes
0answers
20 views

zsh/bash: Expand relative paths in command arguments using logical directory structure rules before execution

So I know that pwd and cd in the shell have a "logical" and "physical" mode (see this SO question and questions linked from there). Now, assume I have this symlink: /home/<...
1
vote
1answer
27 views

Is there a standard Linux utility to generate shared library symlinks?

In an embedded environment that I'm working in, the following files are present: lrwxrwxrwx 1 root root 19 Aug 23 2016 /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1 -> libjsoncpp.so.1.7.4 -rw-r--r-...
5
votes
2answers
174 views

readlink -f and -e option description not clear

-f, --canonicalize canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist -e, --canonicalize-existing canonicalize by following ...
0
votes
0answers
11 views

How to create and 'register' new files inside symlink folder

I created symlink folder and I want to create some new files inside, the problem is they are not 'propagated'/'registered' inside the real folder, if you know what I mean. I need to go to the original ...
0
votes
1answer
39 views

Bash script for monitoring a directory and symlinking all newly created subdirectories and their files

I am in need of a bash script to recursively watch a folder and symlink every new file and subdirectory to another folder. this script correctly symlinks subdirectories and their contents: #!/bin/...
1
vote
1answer
35 views

Creating Symbolic link in SMB share

I am connecting to an SMB share, i have read and write permission. I am trying to create a sym link to a file outside the share, but i get the following error: ln: failed to create symbolic link '9' : ...
1
vote
0answers
12 views

How to extend an external storage device to a chrooted directory?

I run game servers that can generate a lot of data. So I purchased a couple of 12TB drives to store all the data. I've looked into how to link the storage of the drives to a location within a chrooted ...
0
votes
0answers
46 views

Linux redirecting a directory to some other directory only for a specific application

I have run a program that accesses some files from the directory /etc/somedir. What I want to do is whenever it tries to access /etc/somedir/somefile it automatically redirects to /home/arch/...
0
votes
1answer
22 views

How to set X11 conf file as symlink?

Xorg doesn't interpret configuration file from neither /etc/X11/xorg.conf.d/* nor /usr/share/X11/xorg.conf.d/* if said file is a symbolic link. I would like to keep my custom configuration files for ...
1
vote
0answers
21 views

Is it possible to directly access files out of a symlink-directory? [duplicate]

Say I have this directory structure: foo │ ╲ bar baz │ ╲ wun ← wunl │ blarg Here, wunl is a symlink pointing to ../bar/wun. Now I can $ cd foo/baz/wunl/blarg At this point, I'm not “actually” ...
0
votes
2answers
40 views

Symlink Source Target confusion

Every time I try to setup a symbolic link (symlink) I stuggle to get my head around symlink source and target. I have tried this a few ways and it continues to fail. Let me explain. BackupPC v4.4.0 ...
0
votes
1answer
27 views

python3 binary in /usr/local/bin but also…not?

I don't understand what's happening here. I'm on Mac. When I run /usr/local/bin/python3 or /usr/local/bin/python3.8, I get a No such file or directory error. Any ideas what could be going on here? ...
1
vote
2answers
72 views

How to: Find The Name of a Symbolic Link

I made a symbolic link with ln -s /home/orca/www/* /var/ and now I need to delete it. I needed to move all my webfiles which were in /var/www to /home because my / was full. Here is what I did. I ...
0
votes
1answer
46 views

How to find the original file through multiple symlinks? [duplicate]

I've run into situations where symlinks point to other symlinks causing me to have to run multiple ls commands to try to trace where the base file is stored. For example if I want to know the ...
0
votes
2answers
39 views

Symbolic Link command behavior ln -s

If I issue ln -s source.txt symlink.txt and symlink.txt does not already exist, is a link file automatically created called symlink.txt or is the command a noop? If it is a noop, if I just create a ...
1
vote
1answer
16 views

How can I detect when the directory I think I'm in links to a different actual directory?

If I am sshed into my Rails server, and I am in /var/www/some_app/current, it's actually a symlink pointing to (say) /var/www/some_app/releases/20201015004444. If I do a deployment, then current is ...
2
votes
1answer
24 views

Running a bash script from a symbolic link. How to change dir so relative directories work

About the situation: I have a symbolic link named mycommand within $PATH. It links to a file called mycommand.sh elsewhere. That file needs another file, lets call it mycommand2.sh: somedir |-...
0
votes
1answer
21 views

How to correct a link… Or is it a GNOME Desktop menu entry?

Few days ago, I've downloaded IntelliJ in my Downloads folder. I've executed bin/idea.sh installed it, and a convenient icon became available in my GNOME Desktop named IntelliJ, and was shown whenever ...
0
votes
2answers
42 views

How to list attributes (esp. date) of a symbolic link's target file?

When typing ls -la we get the list of files in the current directory, with symlinks having also their target files printed. When displaying a symlink, the shell prints the attributes (and particularly,...
0
votes
1answer
18 views

Symlinked gitconfig resolves include relative to symlink

I added a gitconfig to my dotfiles. To keep things tidy, a symlink at ~/.gitconfig points to the real file, which lives elsewhere. I want to have a section like: [include] path = other-file.txt ...
0
votes
0answers
16 views

How do programs accessing symbolic links differ from users? (What scenarios can break by replacing a file with a symbolic link?)

I think I understand what soft and hard symbolic links are, but I'm not sure how programs access them (as opposed to me, a user). For example, I want to replace my ~/.bashrc with a symbolic link that ...
5
votes
3answers
831 views

Actual content of a symlink file

I searched but couldn't find anything - I am looking for a breakdown of the file structure of a symlink in bytes, in a ext filesystem. I have tried creating a symlink file and then using hexdump on ...
1
vote
1answer
18 views

Separately storing parts of text files and their reconstruction: symlinks with multiple targets?

I have two text files whose headers are different, while their contents is the same. $ cat original_file_v1 header 1 beginning header 1 contents header 1 end common contents line 1 common contents ...
0
votes
1answer
28 views

Error when creating symbolic links

I'm trying to create a symlink but ln says it exist. I cannot see it in FTP and the cd gives me an error. [root@vps82008 addons]# ln -s /root/sendsms/app/addons/sendsms /var/www/html/modul-cscart.com/...
0
votes
2answers
48 views

Can I boot over symlinks?

So I have multiple drives in my pc, but because of the Filesystem Hierarchy Standard it is very impractical to store progams and similar on those drives. I personally also just don't like having ...
0
votes
1answer
41 views

How to find evey softlink to a directory?

Take /etc dir as example. On my system it has 144 links. And as dir's can't have hardlinks (this is my understanding), the number 144 should refer to softlinks (1 original + 143 softlinks). $ ll -i ...
0
votes
1answer
34 views

How to 'apply' soft symbolic links

Is there a command to 'apply' a soft symlink? As in delete the symlink and make a copy of where the symlink pointed to and put it where the old symlink was. I could make a program or alias to do that, ...
0
votes
0answers
16 views

How to remove a symlink in Bash? [duplicate]

I have an old CentOS based, shared hosting environment with Bash 3.2.52; The hosting service team created a symlink from the directory www to the directory public_html, appearing in CLI as: www -> ...
1
vote
0answers
29 views

Rsync, remove source files, symlink

Need help with this one. I am trying to move some folders from source to destination with error handling (because mv failed to close files looking at rsync now) so far this is what I have. But it’s ...
0
votes
0answers
8 views

Tier script local to cloud?

I am looking for a way to basically tier from local storage to my gdrive. I want to keep specific files/folders local and let the rest to be moved and then symlinked to the original location. I am ...
0
votes
0answers
38 views

Move files & folders and Symlink

I am looking for a way to exclude some files/folder and mass move files/folders with spaces and special characters from source to destination and then symlink after move completes. So far I have ...
0
votes
2answers
46 views

recognize symlink from symlinked folder

Let's say I am in console in a subfolder, that is a child (or grandchild, etc.) of a symlinked (soft) folder. From the subfolder, if I do ls -la nothing indicates all the files are inside a symlinked ...
1
vote
1answer
59 views

Distant access to /home directory using bind or symlink

I have a hard drive Data(FAT32) and I want it to contain my /home/username directory and its content so that the /home/username directory is 'artificial'. I have attempted to : use symlink (ln -s /...
1
vote
1answer
54 views

When should you make a symbolic link instead of making an alias?

It's possible that making a symbolic link is not at all comparable to making an alias. But from what I understand about symbolic links so far, they do the same thing as setting an alias: they define a ...
5
votes
3answers
1k views

Create old style 'slow' symbolic links

ln -s creates 'fast' symbolic links. These break if you copy them (and their targets) to e.g. optical media. I believe old style 'slow' symbolic links would work, but how can I create them? There's no ...
0
votes
1answer
24 views

/etc/mtab as a symlink on Centos6

On a Centos6 system, can I delete /etc/mtab (the file) and create it as a symlink to /proc/self/mounts? As I understand it, starting from Centos7 (and other newer distros), the file /etc/mtab no ...
0
votes
1answer
29 views

Unable to create symbolic link of compiled executable to my PATH directory

I've compiled this build of the SameBoy Game Boy emulator with success. However I'm unable to ln -s the resulting executable to my PATH directory in ~/.bin/, as it returns too many levels of symbolic ...
0
votes
2answers
172 views

Access windows symbolic link from linux cifs

I have created symbolic link of the mapped drive (DOS share) on Windows 7 computer 200.90.12.25. The symbolic link was created using mklink command. Trying to access this from Linux (Raspberry PI) ...
0
votes
1answer
273 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 -&...
0
votes
1answer
27 views

Do programs themselves use symbolic links, or are they just for users?

For example, when I type python it runs python2 because for me, /usr/bin/python is linked to /usr/bin/python2.7 But does this affect programs? If there are programs on my system that need python 2, ...
1
vote
1answer
196 views

Apache 2.4 does not follow symlink and gives 403 Forbidden?

I have been trying to setup my project on localhost as symlink into /var/www/html, I can access normal files or directories placed inside html but when I create a symlink to some/other/path, it gives ...
0
votes
1answer
48 views

Trying to find examples of --strip-trailing-slashes

I find the --strip-trailing-slashes option of the mv command confusing. According to the official GNU manual, this option is "useful when a source argument may have a trailing slash and specify a ...
0
votes
2answers
33 views

Linking and Copying

I have a few questions regarding links in UNIX Can I say Soft links in UNIX are analogous to shortcuts in windows? Difference between copying and hard-linking? Can anyone give me a use-case where I ...
2
votes
1answer
50 views

Prevent mv from moving target folder

If symbolic link bar points to folder foo, then the two following commands have very different behaviors: mv bar baz # rename link 'bar' to 'baz' mv bar/ baz # rename folder 'foo' to 'baz' (...
1
vote
1answer
23 views

rsync update symlinks pointing to same directory

I want to use rsync to make a copy of a folder that contains symlinks to other files in the same folder. Is it possible to get updated symlinks -pointing to absolute paths- in the destination? I mean, ...
0
votes
0answers
34 views

How to get the original filename of symlinks in nginx?

From another script i got some generated symlinks. 2QGPCKVNG1R -> /anotherdir/movie1.mp4 HJS7J9ND2L5 -> /anotherdir/movie2.mp4 LKA6A9LA7SK -> /anotherdir/movie3.mp4 Displaying these files in ...
0
votes
0answers
46 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 ...
0
votes
1answer
52 views

Reconfigure dangling symlink libc.so.6

I didn't do the cleverest thing and changed the /lib64/libc.so.6 symlink - better still it points to something that doesn't exist - and best of all, the path it points to is within /lib/, a folder ...
0
votes
0answers
10 views

Extract name from symbolic link in bash [duplicate]

I have created symbolic links to files with cryptic filenames to avoid problems in my scripting pipeline. Now I need to research the original files. Therefore I need to get the original filename. ...
0
votes
1answer
71 views

what is difference between symbolic link file and executable file?

I was exploring the /bin directory. The /bin contains file of two different colours, which according to this answer correspond to: Green indicates executable file Sky blue indicates system link In ...

1
2 3 4 5
20