Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
28 votes
2 answers
3k views

What does "6" mean in glibc.so.6?

When exploring the C++ binary, I find that libstdc++.so.6 is dyn-linked into libm.so.6 and libc.so.6: $ ldd /lib/x86_64-linux-gnu/libstdc++.so.6 linux-vdso.so.1 (0x00007ffcb737b000) ...
syheliel syheliel's user avatar
4 votes
2 answers
333 views

How much space do I need to create a symlink?

I have a server which contains 1 TB of space. I filled it to capacity; then I wanted to make a symlink. I removed a different symlink, but the server still wasn't happy - it said I didn't have any ...
Yehuda's user avatar
  • 301
1 vote
0 answers
19 views

Symlink from snap package points to a different file than as described by `ls -l`

Recently I installed the tradingview snap package, and I wanted to add some launch flags so I decided to inspect the package. Opening the tradingview_tradingview.desktop file shows that it executes a ...
Jark's user avatar
  • 11
0 votes
0 answers
49 views

Copying symlinks as symlinks

I’m attempting to copy a symlink of a file in one directory to another directory. I need the copy to be a symlink, not a hard link or a broken symlink. cp -A and cp -P generated broken (flashing) ...
TheorVHP's user avatar
0 votes
1 answer
40 views

How do I copy directory structure as symlinks inside other directory

I am looking for an easy way to backup all my dotfiles in a git repository. Solution that I'm aiming for: have git as my source of truth for my dotfiles contents in my home directory backed up files ...
Artem Sevos's user avatar
0 votes
0 answers
38 views

nginx can't follow symlinks even after "disable_symlinks off;" setting

I have django/gunicorn/nginx based site. The static files when changed and deployed to the server get uploaded to /home/username/src/static folder. The website itself is provided from /home/username/...
user1933205's user avatar
0 votes
2 answers
40 views

Symlink on mounted drive that will work after unmount

So, I am working on some sort of bash script, that basically works as industrial PC installer. Basically, what it does is, it mounts HDD (or SSD), copy a working image template on it using dd, than ...
rRr's user avatar
  • 151
0 votes
0 answers
43 views

Files on Windows but Symlinks on Linux?

I've recently started dualbooting Pop_OS and Windows, and it's been generally difficult, but this issue is, at best, completely confounding. Some seemingly random files are displayed as broken ...
Paynamia's user avatar
1 vote
1 answer
44 views

What's limiting the depth of a recursive symlink chain?

Out of curiosity, I ran the following: mkdir haha cd haha ln -s ../haha haha Which created a recursive structure like this: ┌────────┐ V │ haha/ │ haha/────┘ I wanted to see how ...
CarmenCarmen's user avatar
0 votes
2 answers
74 views

How can I change the name an executable presents itself to the system

Forgot to mention, running on Suse Tumbleweed, Desktop is KDE Plasma. I have in my bin directory a symbolic link to mpv, $ ls -l bin/Play lrwxrwxrwx 1 boffi users 12 Feb 11 12:33 bin/Play -> /usr/...
gboffi's user avatar
  • 1,404
0 votes
0 answers
43 views

Issue with `libz.so.1` when running PhantomJS

After extracting the file contents from the phantomjs archive, I ran the command phantomjs and was met with the error: phantomjs: error while loading shared libraries: libz.so.1: cannot open shared ...
Michael Sodeke's user avatar
1 vote
1 answer
56 views

Changing permissions of a symbolic link (exercise from school) [duplicate]

My school asks me to create files and directories in such a way that the ls -l output looks like that (XX are not taken into account): I've done everything right, except for the symbolic link at the ...
Shoopi's user avatar
  • 31
1 vote
1 answer
51 views

mirror a directory tree by hard links for file contents and symlinks for directory structure

what is the best way to mirror an entire directory, say original/, to a new directory, say mirror/, which has the structure mirror/data/ and mirror/tree/, such that every file in the directory ...
windfish's user avatar
  • 113
1 vote
0 answers
59 views

How can I make symlinks imperceptable to Firefox?

I'm running Ubuntu 22, and Firefox is installed via snap. It stores profiles and cache in /home/username/snap/firefox/common. I want to preserve profiles across system disk restores, and so I like ...
Duncan Marshall's user avatar
4 votes
1 answer
647 views

Is it possible to disable symlinks when mounting a partition?

I have an embedded system development setup which is supposed to restrict users from accessing any system folders. On a USB stick I created a symlink to "/" (root folder) and when I click on ...
DEKKER's user avatar
  • 958
0 votes
0 answers
77 views

AppArmor rule that allows access to any file in home directory via a particular symbolic link

The following AppArmor profile allows the program myprog to read the user's configuration file found at ~/.myprogrc. abi <abi/3.0>, include <tunables/global> profile myprog /usr/bin/...
Flux's user avatar
  • 2,948
0 votes
1 answer
51 views

Why does GNU tar's --dereference option not cause it to dereference symlinks?

I thought I knew how GNU tar -h (aka --dereference) worked, but now I am confused. Consider: $ tree dir/ dir/ ├── file └── link -> file 1 directory, 2 files If I add -h to my tar command, shouldn'...
Brad Spencer's user avatar
0 votes
0 answers
73 views

Does "yum clean all" remove symlinks?

I am running confluent upgrade playbooks to upgrade the version. My OS is RHEL 7 and I have installed Python 3.9 and created a symlink to it from /usr/bin directory. When running the confluent ...
adbdkb's user avatar
  • 103
0 votes
0 answers
39 views

Linux so convention: is the .so link intended to come from dev packages?

On my Ubuntu jammy Linux PC, after installing the libuv1 package (apt-get install libuv1), I noticed that there was a file, named libuv.so.1.0.0 and a symbolic link to it, named libuv.so.1: $ find /...
StoneThrow's user avatar
  • 1,737
0 votes
0 answers
30 views

Apache symlink to directory on Raid Drive [not working]

I have a Debian install. It's not my first (but third server, without counting multiple raspberry hanging round) Let say my user is named "user1" Novelty for me, I have a a first disk ...
mapStack's user avatar
0 votes
1 answer
62 views

Substitute a new man page for an older one

I've just built (from source) a current version (ver 2.1) of libgpiod on my RPi 4B. There are six (6) "command-line tools" included in the source tarball for libgpiod. During the make ...
Seamus's user avatar
  • 2,971
0 votes
1 answer
50 views

Unable to symlink directory with all file contents

I want to symlink locations to ~/locations. So that everything in locations appears in ~/locations: λ tree locations/ locations/ ├── adelaide │   └── config ├── amber │   └── config ├── austin │   └──...
Nickotine's user avatar
  • 467
0 votes
0 answers
55 views

systemd - Is this how to require a service by an installed program?

The essence: I want the systemd to symlink specific directories to /tmp/some_folder before it starts services from various installed packages and system services (like cups, pacman, etc.), the reason: ...
donaastor's user avatar
  • 214
0 votes
1 answer
57 views

does rsync switch -a (ARCHIVE) always includes -l (symlinks)

does rsync option -a (ARCHIVE) always includes -l (symlinks) in linux systems? I was revising some old scripts containing both options and thought to drop unneeded options. The script might be used by ...
Serge's user avatar
  • 121
0 votes
0 answers
41 views

How to symlink with cifs ext3 disk? Permission denied

$ sudo ln -s ~/somefile /media/fritz fails with Permission denied. I'm perfectly able to $ touch /media/fritz/foo.txt /etc/fstab/: //fritz.box/FRITZ.NAS/ /media/fritz cifs credentials=/home/me/....
jjk's user avatar
  • 411
-2 votes
2 answers
63 views

Moving files to new drive - but preserve Symlinks (lots of them) from a backup application

I have used a backup program from the last few years that uses Rysnc to backup my files and maintain versions etc. The system in question is Rsync-time-backup - https://github.com/laurent22/rsync-time-...
Craig Curtin's user avatar
0 votes
0 answers
178 views

why does running nixos-rebuild switch --upgrade gives symlink error after switching to unstable channel?

Nevermind, i fixed it, by manually running nix-channel update before running nixos-rebuild switch --upgrade I am trying to upgrade from nix-23.05 to unstable but I'm getting some weird errors. Heres ...
somethingsomething89's user avatar
0 votes
0 answers
73 views

Mount but exclude one subfolder?

I have a Synology NAS in which I use the following command at NAS startup to create a symlink, which works fine: mount --bind "/volume1/SourceFolder" "/volume1/SymlinkFolder" Now I ...
Ahmad's user avatar
  • 101
4 votes
6 answers
1k views

Is there any elegant way to find only symbolic links pointing to directories, not other files?

find -type l and ls -l | grep '^l' show symbolic links but do not distinguish between symlinks pointing to directories and those pointing to files. A very kludgy way to do something like this is find -...
Adam J. Kessel's user avatar
1 vote
1 answer
63 views

Trying to create same folder structure and symlink files using Cygwin Terminal

Followed this post - How to copy a folder structure and make symbolic links to files? cp -al /src/dir /dest/dir # hard-links to leaf-files cp -as /src/dir /dest/dir # symlinks to leaf-files ...
trentmsteel's user avatar
0 votes
1 answer
95 views

How to use sed on symbolic linked files?

I have some symbolic linked files and some normal files like below: P_2_UC34_31_1.gz P_2_UC34_31_2.gz P_2_UC34_32_1.gz P_2_UC34_32_2.gz P_2_UC34_33_1.gz P_2_UC34_33_2.gz P_2_UC34_31_1.gz and ...
beginner's user avatar
  • 277
1 vote
2 answers
2k views

Inaccessible folders: Too many levels of symbolic links

In my home/, the folders Desktop, Downloads, Public, and Templates cannot be accessed anymore. For some reasons, those XDG user directories turned into symbolic links. ticjo@komputilo:~$ ls -l total ...
TVG's user avatar
  • 143
0 votes
0 answers
220 views

Error opening directory with Okular due to "Too many levels of symbolic links" in Ubuntu 22.04

This location could not be displayed. Sorry, could not display all the contents of "Documents": Error opening directory '/home/arijit/Documents': Too many levels of symbolic links I ...
ARIJIT GURIA's user avatar
0 votes
1 answer
85 views

how to copy symlinks without dereferening them from an external hard drive (NTFS)?

I am moving my files from one computer to another via an external hard drive formatted with NTFS. I have a folder called "library" with many PDFs. This folder contains quite a few symlinks ...
Wolfhart's user avatar
0 votes
0 answers
87 views

Shell script: check for file doesn't work if there is a symlinked directory involved?

If I have /mydir/myfile.txt this code echos file already exists if [ ! -f "/mydir/myfile.txt" ]; then touch "/mydir/myfile.txt" echo "created file" else echo ...
d-b's user avatar
  • 1,939
4 votes
1 answer
404 views

ln will not create symlinks to nonexistent targets / target without permission

First of all please note that I'm on a shared server and I don't have root access, so anything involving su or sudo would not be possible. AFAIK ln and Linux should not even bother checking whether ...
Dan's user avatar
  • 141
-1 votes
2 answers
87 views

Why is "This only works if you cd into the actual directory and not to a shortcut to it"?

https://unix.stackexchange.com/a/624808/ says: A simple way: cd into the directory of the files Run ffmpeg -f concat -safe 0 -i <(for f in ./*.mp3; do echo "file '$PWD/$f'"; done) -c ...
Tim's user avatar
  • 102k
0 votes
0 answers
20 views

How to share project directories into SFTP home directory of members

I've a requirement that when a user logs in, they should see the shared directories of the projects they are a part of, in the user's SFTP home. They should not see any other project directory. Users ...
Jonny Marotte's user avatar
0 votes
1 answer
36 views

Is there any backside to creating a softlink instead of the various default folders inside /home?

I'd like to know if there are any backsides to replacing the various default folders (specifically: Documents, Downloads, Music, Pictures, and Videos) with symlinks to a different drive? Basically, I ...
telometto's user avatar
  • 1,985
0 votes
1 answer
53 views

What is the best way to monitor a folder and dynamically symlink items into a different folder?

I have a second hard drive which has the following structure: $ tree -L 1 . ├── Documents ├── Music ├── Pictures └── Videos I want to monitor these folders for changes and, if any, create a symlink ...
telometto's user avatar
  • 1,985
0 votes
0 answers
139 views

How to check when a symlink was created?

There is a symlink linked_dir in dir, and I am trying to find when it was created. Within dir, I ran stat -c %w useq_242_nyc But the only output is - How can I check when this symlink was created?
anonuser01's user avatar
0 votes
1 answer
112 views

Writing permission to symlink

I have a directory (linux container) on a remote server to which I don't have writing access. I created a symlink to use this container locally. When I run the symlink of the container with docker ...
Sandy's user avatar
  • 1
0 votes
0 answers
31 views

symlink makes a file that copies target file

I'm trying to make a link (called mass) from ~ to a target in ~/Documents. I have tried this command: $ ln -s Documents/mass.gnumeric mass However, that produces a file ~/mass that, when double-...
account-minute's user avatar
1 vote
0 answers
39 views

eCheck if it's safe to move a directory and replace it with a symlink

Say the directory you want to move has absolute path DIR. A case where it is NOT safe: that directory has either absolute path symlinks to within DIR itself. For instance DIR/link -> /PATH/TO/DIR/...
extremeaxe5's user avatar
  • 1,183
0 votes
1 answer
179 views

Temporary symlink in shell - "named process substitution" - rename a file without creating a copy/symlink on the disk?

Thunderbird doesn't open files that don't have .eml extension as email files, but instead starts to compose a new message and adds them as attachments. To use thunderbird in scripts I'm looking for a ...
Daniel Krajnik's user avatar
0 votes
0 answers
42 views

How make multiple files available as one, akin to symlinking?

Is there a way to take a list of files and make them available under a single name (in a read-only fashion)? Let's say I have: f1.txt f2.txt f3.txt And I would like to read sequentially through all ...
miku's user avatar
  • 673
0 votes
2 answers
246 views

ln -sfn vs rm vs unlink

I would like to remove a symlink and link it to something different, and I think there are 3 ways to do this: ln -sfn source dest rm dest ln -s source dest unlink dest ln -s source dest Are all 3 ...
anonuser01's user avatar
2 votes
1 answer
896 views

Is it safe to remove a directory that has a mixture of symbolic links and subdirectories?

I have a directory, dir. Inside dir, there are symlinks and regular subdirectories. I want to remove dir and create a symlink for dir to point to another directory. If I simply do rm -rf dir, I ...
anonuser01's user avatar
1 vote
2 answers
204 views

dos2unix cannot follow symlink if link targets file on another partition

I have a text file a.txt with CRLF endings which is the target of a symbolic link link.txt. By default, dos2unix does not follow symbolic links. I have to add --follow-symlink for that. It works if a....
fdamien12's user avatar
0 votes
1 answer
733 views

Broken shortlink after Ubuntu was restarted. Too many levels of symbolic links

My shortlink which used to work suddenly is shown as broken after I restarted the PC having Ubuntu 22.04.2 LTS. I moved the "Documents" directory to another disk which is HDD and made a ...
ravi's user avatar
  • 143

1
2 3 4 5
24