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.
1,189 questions
0
votes
3
answers
117
views
Why can't I use `rm -r` on a symlink pointing to a directory?
I understand that in unix systems symlinks can link to files and directories and are files themselves so if I want to remove a symlink I need to rm symlink without the trailing /.
But they otherwise ...
2
votes
1
answer
130
views
rsync script for incremental backup which continues unfinished jobs
I have a script which does incremental backups with rsync (script 1). I tried to add the feature to continue unfinished jobs in another script (script 2) but this version does a full copy of the ...
2
votes
2
answers
285
views
Tar cannot create symlinks on extraction
The command run to un-archive is as follows:
tar -zxvpf my_files_weekly.tar.gz --exclude=/etc/ssh/ -C / > /dev/null
Results in the following errors:
tar: ./usr/share/doc/udev: Cannot create ...
0
votes
1
answer
49
views
openSUSE 15.6 sysctl pointing to itself
I have just run zypper up on a openSUSE 15.6 computer and the installation of the new kernel says dracut-install error: /sbin/sysctl is pointing to itself and indeed this
symbolic link is a loop:
king:...
1
vote
2
answers
83
views
Non-recursively Symlinks for a Directory
I’m trying to create a single relative symlink pointing public/train/train back to public/train, but my command ends up nesting infinitely. For example:
ln -snrf "$ROOT/public/train" "$...
0
votes
1
answer
45
views
How to resolve a relative symlink to an absolute one without canonicalizing it?
On my machine, there is a file:
/var/lib/flatpak/exports/bin/com.github.tchx84.Flatseal
Which is a symlink whose content is:
../../app/com.github.tchx84.Flatseal/current/active/export/bin/com.github....
1
vote
3
answers
159
views
In bash, how to resolve what is actually going to be executed?
Bash has the built-in command "type", which indicates how each argument would be interpreted if used as a command name, for instance:
$ type myfunction
myfunction is a function
myfunction () ...
11
votes
6
answers
3k
views
Why are symbolic links more common than hard links in Unix/Linux? [closed]
I frequently find myself googling the difference between symbolic links and hard links. Each time, I conclude that hard links seem superior in most use cases, especially when Linux is my daily driver. ...
6
votes
1
answer
710
views
tar not preserving symlinks
How to create an archive containing links and the linked files. I have some shared libraries of which I want to create an archive. This is what I tried
mkdir dest
#abc.so is a link file which points ...
0
votes
0
answers
36
views
CIFS mount containing windows symlinks access
For years I used a setup where I have a CIFS mount to a windows share directory. This directory contains symlinks to other windows location.
Trying to replicate this on the latest raspberry pi OS (...
0
votes
2
answers
120
views
Why are some symlinks unreadable when their target is readable?
On Linux, I'm looking at /proc/1/cwd. This symlink is not readable as a normal user:
$ ls /proc/1/cwd
ls: cannot access '/proc/1/cwd': Permission denied
But /proc/1 is accessible:
$ ls /proc/1
<...
4
votes
1
answer
188
views
Can Linux files systems resolve a relative path before resolving symlink?
New Linux user here, freshly transitioned from Windows 10 to Fedora 41. Lot's of experience with many OS's, including various *nix and Unix-like file systems.
I have a standard practice of using ...
0
votes
3
answers
379
views
/bin, /sbin symlinks mysteriously breaking, init file disappearing. How to debug?
Similar to here, but no solution was found for them either. I also tried checking the history, see if something was running 'rm' but no dice.
Periodically, my device stops responding. The only ...
0
votes
1
answer
41
views
Symlinks with data inside directory
I'm using this symlinks
ln -s "$REPO_DIR/src/packages/my-project/out" "$OUTPUT_PATH"
Currently, my OUTPUT_PATH only has only 1 folder out
How can I make my OUTPUT_PATH has all the ...
4
votes
2
answers
315
views
How to find and list all symlinks in a short form?
I have a large set of directories and files, along with many symlinks that typically point to a directory called "shared" or to a directory or a file underneath the "shared" ...