Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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 ...

0
votes
0answers
13 views

Disable commands in Alpine Linux

I want to attempt to increase the security of some Alpine Linux Docker containers which run Nginx and other servers. I would like to disable commands like ls, cat, ed or sed, so that they are ...
2
votes
1answer
15 views

Where do I find the allowed maximum number of symlink dereferences? [duplicate]

In the book The Linux Programming Interface, it says The kernel imposes limits on the number of dereferences to handle the possibility of circular chains of symbolic links. Where can I find ...
1
vote
3answers
71 views

I need to find only directories in the directory but exclude a linked directory and its link

I am in a root directory and have some folders inside: 0.1 0.2 0.3 0.4 0.5 0.6 shortcut -> 0.6 I need to list the above directories without both shortcut as well as 0.6 folder. I don't won't to ...
1
vote
3answers
69 views

Linux 'cp' Copies Symlink Instead of Target File

In my directory I have 2 files: a text file and a symbolic link to that text file. base_v21.txt -> base_v001.txt base_v001.txt When I try to copy base_v001.txt using the following command: # cp ...
0
votes
1answer
23 views

symblic link across a mounted fs

I have access to a disk that has been mounted across servers such that the directory storage2:/sdb1/users is visible from my server at local1:/mnt/storage2/users. There's a big file I'd like access ...
0
votes
0answers
25 views

New user able to access specific folder of another user dir [closed]

I'm running CentOS7 and currently have a couple of game servers running on my box under /home/game/acservers. I would like to create a separate user with out sudo access and allow him to access /home/...
1
vote
0answers
16 views

Why does conda not use symlinks for duplicate dependencies? [closed]

I wondered whether conda actually made duplicate files for certain dependencies shared by independent environments. I installed two environments env1 and env2. Then I installed the same module ...
1
vote
1answer
28 views

How to create a custom command or shortcut/symlink to run the standalone program?

Friends I have downloaded tor bundle which is a standalone package. I'd like to create a custom command "torbrowser". I followed these steps, --> I copied entire tor bundle to my /usr/local directory ...
0
votes
2answers
32 views

How can I trick Plex Media Server into writing logs to a black hole?

The quick version: I want to point my '/volume1/Plex/Library/Application Support/Plex Media Server/Logs/' directory to a black hole, so nothing gets written to it. Is there a way to do this? Will it ...
1
vote
1answer
49 views

How do hard links, symbolic links, and ACL folder permissions interact?

This one was a bit tricky for me to realize, but I came across a very weird behavior involving ACL extended file permissions and hard/symbolic links. I'll do my best to keep my question short and to ...
1
vote
1answer
39 views

Move directory structure and preserve symlinks [duplicate]

I'm trying to work around a makefile issue where libraries are installed in the wrong place. Someone else wrote the makefile and it is not easy to fix. I'm trying to move the libraries after they have ...
0
votes
3answers
34 views

Is working in symlink directory identical to working in the directory directly? [duplicate]

In my home directory, I have a folder named symlinks in which all my symlinks live. I've added this folder to my CDPATH, so that I can do: ~$ cd FarAwayDirectory ~/symlinks/FarAwayDirectory$ I’ve ...
0
votes
1answer
22 views

Replacing a symbolic link after replacing target

If I have a symbolic link to a target file and I replace the target file's data, keeping the same target name, do I have to delete the symbolic link and create it again ?
0
votes
0answers
19 views

How to execute a cgi pointed to by a symlink?

My website has several cgi's (executable binaries compiled from C source, in case that matters) that work fine when run from a browser as, e.g.,       http://mydomain.com/cgi-bin/...
0
votes
1answer
62 views

“No such file or directory” error on existing file?

I have an issue with a binary(?) that simultaneously seems to exist and not exist. $ ls -l /usr/local/bin/vue lrwxr-xr-x 1 myusername admin 73 Jul 14 15:31 /usr/local/bin/vue -> ../../../Users/...
0
votes
1answer
38 views

Link hidden directories

I would like to completely link /root/.vidoes/ to the new directory /home/videos/ If a script tries to read/update/save a file to /root/.vidoes/ for example /root/.vidoes/newvideo.mp4 then it should ...
0
votes
1answer
44 views

How to get the filename of a symlink destination in a shell script?

let's say the scriptname is myscript. It's a symbolic link to thescript_1.91.sh Is there a way to get the name of the link destination? An example: I want to write in a logfile cat <<EOF ####...
1
vote
1answer
35 views

To Symlink or not to Symlink?

Prefacing this by saying I'm pretty new to Linux/Computers. I'm working on doing a yum update on an outdated RHEL (7.2) system. I'm currently not able to install anything new or change the disk ...
0
votes
2answers
70 views

mkdir -p if final target is symlink

Say we have: node_modules/ suman/ and node_modules/suman is a symlink if we do: mkdir -p "$PWD/node_modules/suman" I assume mkdir -p will not overrwrite the symlink? what about if $PWD/...
-1
votes
1answer
40 views

Why do relative paths that traverse a symlink in reverse resolve using the true path?

Either I've completely misunderstood something about symlinks (most likely), or their behaviour has changed at some point and I'm now catching up. I have a script directory that resides somewhere on ...
1
vote
1answer
37 views

Allow patch of symlinks

When I try to run a patch command with a patchfile against a link, patch gives me the error: File path/to/file is not a regular file -- refusing to patch The following command produces this error ...
0
votes
1answer
6 views

File popups freeze in specific directory and show nothing - how to fix?

I had this issue for months. Whenever I moved to my home directory within a file popup (from both qt and gtk), the window freezed and I could neither close it nor move to another directory. I just had ...
1
vote
1answer
185 views

Symbolic link not working on nginx [closed]

Nginx is working fine with root path without symbolic links(Eg.../1.0/public). When a symbolic link is used(Eg.../current/public where current is a link to 2.0) the changes don't get affected until I ...
0
votes
0answers
27 views

Binary representation of Symbolic Link

I am working on a ctf and I want to upload a Symbolic Link that points to a file instead of uploading a regular file. I want to know if there is there a way to build a symlink by hand or to copy the ...
1
vote
2answers
46 views

rsync with symlink on path [closed]

Say we have a path on our directory like: a/b/c/d/e where c is actually a symlink, a/b/c -> f And f contains d/e. Then when I run rsync -avzR, without the --copy-unsafe-links flag, it will ...
2
votes
1answer
34 views

Symlink some file of a tree to another folder and conserve folder structure

Assuming this tree (top-X & tX-sub-X are folders, and all sub-folder containing a .csv and various other file extensions.) Base ├── top-1 │ ├── t1_sub-1 │ ├── t1_sub-2 │ └── t1_sub-3 │ └─...
3
votes
2answers
42 views

Difference between rm my-symlink and rm my-symlink/

Just wanted to know why if I use rm -rf my-symlink it deletes the symbolic link only but rm -rf my-symlink/ deletes the files within the linked directory and leaves the symbolic link alone?
2
votes
1answer
76 views

How to create a symbolic link from one user directory to anothers?

I have 3 users: admin with sudo, and two normal users - user1 and user2. user2 is under user1 group. There is a folder fold1 as /home/user1/fold1 which is under the group user1 with read and write ...
0
votes
1answer
84 views

rsync --update with symlinks

This is related to this question but I don't think the answer exactly applies here. I have two servers that sync directories between each other. These directories contain files and symlinks. On ...
1
vote
1answer
194 views

`ls` Attemptes to list nonexisting symbolic links on WSL

I have clean installed windows 10 (build 1803). I have installed Ubuntu from the Microsoft Store and enabled Linux subsystem. I have done this several times in the past, and never have I had the ...
1
vote
0answers
30 views

How to teach AppArmor about toplevel symlinks

I have my "root" partition split into two: a normal one that contains most files and a second one used for those areas that can "grow". Concretely, this means, I have symlinks like: /var/log -> ...
0
votes
0answers
22 views

How can we change a symlink to be a copy of its target file? [duplicate]

$ ls -l total 4 -rw-rw-r-- 1 t t 6 May 14 00:01 myfile lrwxrwxrwx 1 t t 6 May 14 00:01 myfile2 -> myfile $ cp myfile myfile2 cp: 'myfile' and 'myfile2' are the same file $ cp -P myfile myfile2 cp:...
0
votes
0answers
22 views

Terminal / bash - $HOME is not displayed as ~ [duplicate]

When starting Terminal (bash), my prompt is: user@pc:/mnt/home/stud/user. Executing cd ~ it changes to user@pc:~ and pwd now is /home/stud/user as in getent passwd. I soft linked /home/stud to /mnt/...
0
votes
1answer
36 views

Can rsync copy directories over links

I have the following scenario where I need to copy directories which sometimes can be links and sometimes a directory with the same name. For instance, suppose this is the initial setup: Source: /...
0
votes
1answer
39 views

A command's output and its symbolic link's output do not match

I am using RASPBIAN on my raspberry pi. I find out that the command "apropos" is a symbolic link of the command "wahtis". However, the output of those commands do not match when used with the same ...
0
votes
2answers
90 views

What is the meaning of 'ln -sT' in Linux?

To be more precise: I know what the -s options stands for - I use it daily. But I saw someone in a tutorial, who was moving the document root of his website from /var/www/html/project to ~/www/project ...
0
votes
0answers
33 views

Find with '-type d' not working if the path contains symlinks?

I have a directory structure something like this (I've simplified it for this question): /dirX /dirX/d/d1 [and contained files+subdirs] /dirX/d/d1/d2 [and contained files+subdirs] /dirX/d/d1/d3 ...
2
votes
2answers
314 views

Cannot start Springboot as init.d service on port 80

I've been following the official guide to setting up Springboot as an init.d service on an Amazon Linux ec2 instance. Before I got to this setup, I was running into the problem where I could not start ...
0
votes
4answers
92 views

Count number of files that are not symbolic links in output from “locate”

I'm trying to count the number of non-symbolic linked files passed by the locate command. I've tried a number of options and think this is the most promising: locate -r "$PWD.*\.c$" | xargs -0 -I{} ...
0
votes
1answer
50 views

Why does `rm` claim my symlink is a directory? [duplicate]

I made a symlink to a directory like this: ln -s /some/directory symlink Now I'd like to remove the symlink: rm symlink/ This doesn't work. The error message is: rm: cannot remove 'symlink/': Is ...
1
vote
1answer
26 views

Question related to symbolic links and copying

So the following command copies from /source/allsubdirectroies (/usr/hdp/2.6.3.0-235) to a /target (/tmp/jar263) folder: find /usr/hdp/2.6.3.0-235 -type f -name "*.jar" -exec cp {} /tmp/jar263 \; ...
0
votes
0answers
32 views

Best practice with symlinks, localhost wiki

What I think I want to do is to use a symlink so that I can diddle the innards of a Dokuwiki website I have hosted on localhost: The website is installed and seems to be working well on /var/www/html/...
0
votes
3answers
54 views

Create symbolic links for multiple books collected from command `find`

I'd like to create symbolic links for multiple books searched from running find command. Firstly, I collect all the JS books find ~ -type f -iregex '.*javascript.*\.pdf' > js_books.md 2>/dev/...
1
vote
1answer
98 views

Create hard link if possible, else use symlink

I am trying to write a shell script to create link for file from my dotfiles repo to my home folder. I want to use hard link if possible because it cannot be broken when moving it to somewhere in ...
1
vote
1answer
27 views

Why can't a project compile with symbol link

I'm working in a team, which develops a c++ (ROS) project. For some reason, we haven't a good git management. We have several git branches. To compile the project, I have to git clone the codes from ...
-1
votes
1answer
78 views

Apply readlink to a non-symlink file?

The following code from https://stackoverflow.com/a/920834/156458is to get the pathname to the parent directory of a script inside the script, even if the script is run via a symlink to it: if [ -L ...
1
vote
0answers
989 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 ...
0
votes
0answers
48 views

Can't delete a symlink from /usr/lib [duplicate]

I'm on Fedora 27. I want to delete a symlink from /usr/lib, but can't because of Operation not permitted. I'm under root and here are commands and the output: [root@thinkpad lib]# ls -al cpp ...
0
votes
1answer
39 views

Is there a tool to auto delete all invalid symbolic links?

I have a Fedora workstation, when upgrade the system some software for example LibreOffice do not delete its old symbol link in /usr/bin and when I update other software, there are a lot of warnings ...
1
vote
1answer
67 views

Inconsistent behavior of Bash's `cd` with symbolic links [duplicate]

I am currently trying to wrap my head around the behavior of Bash's cd when it comes to symbolic links. By default, cd should follow the logical directory structure and should not resolve symbolic ...