We’re rewarding the question askers & reputations are being recalculated! Read 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
1
vote
1answer
9k views

soft link vs. hard link

What does that mean that a soft link can cross file system boundaries ? Does that mean that I can create a soft link on a ext3 to a file on a ext4 files system ? Also, while I understand (at least I ...
2
votes
1answer
165 views

What is the difference between -H and -L options of chown?

From the chown manpage: The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect. -H if a ...
0
votes
1answer
47 views

How to create a symlink so that modifications are transfered to the orignal file?

I never created a symlink but I installed bitcoin core and I need to put the blockchain on a different hard drive (let's call it A) than the wallet (on hdd B). So my idea is to create a symlink of the ...
1
vote
0answers
133 views

Symlinks created but not “there” SSH

I am creating Symlinks for Magento purposes but for some reason something is going wrong. I created the symlinks using PuTTy SSH. So I did this: cd /home/user/domains/newwebsite/public_html/ ln -s /...
0
votes
1answer
2k views

What is the difference between “find -H” and “find -L” command?

When I executed the command both commands gave the same output. I created a soft link and a hard link for a file but still both commands gave the same output. Is there a difference between find -H and ...
1
vote
2answers
232 views

Linking file systems with removable media

Is there a way to create a link between something like /usr/bin and /removable/SD Card/usr/bin? I have a chromebook with crouton installed and a 128GB SD Card. I would like to be able to store some ...
-1
votes
3answers
739 views

How to change the way the Linux File System is interpreting my file? My source code file is read as a 'broken link', despite it still a text file

After some operation as run some make files, and emulators, a source code file (*.cc) is read as a 'broken link', despite it still the same file. I know it is the correct file because the (*.cc) file ...
3
votes
1answer
306 views

How do you point to non-default php version without sudo in terminal

Problem: When I ssh to my web server and run anything with "php", it runs an old php 5.2 for some reason. The link /usr/bin/php points to the wrong version. I cannot change this symlink. What I ...
3
votes
1answer
51 views

can you alias to a position inside a file?

Is there a way to create an alias that will open a pdf or other document to a particular position? For example, I have a 105 page pdf which I want to alias/shortcut to in a directory on my system. But ...
2
votes
1answer
846 views

How does restorecon handle links?

I noticed that the rule /usr/sbin/shutdown -- gen_context(system_u:object_r:shutdown_exec_t,s0) labels /usr/sbin/shutdown shutdown_exec_t when /usr/sbin is a directory. But it doesn't restore the ...
2
votes
1answer
552 views

Make `rsync --link-dest` find files recursively

I'm using Rsync as a backup tool. When I create a new backup, I would like it to look in all the existing backup folders for each file and if it already exists, create a hard link. From the Rsync man ...
4
votes
0answers
251 views

How to swap a (log) file that a process has opened with a symlink to another file?

I have two processes that are writing to a log. ~/app/log/debug.log For storing logs, I created a separate disk, mounted at /mnt/logs/, it also contains a /mnt/logs/debug.log file. However, I ...
2
votes
1answer
1k views

How to make $ORIGIN in RPATH not follow symlinks?

I have an executable app, which depends on a library libbar.so and loads it via RPATH with $ORIGIN like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type ...
4
votes
1answer
506 views

what is the syntax of INPUT in so file

When I study the Clang for x86_64 Ubuntu 16.04 Pre-Built Binaries, I see that the libc++.so is not a soft link to the real shared library, it is a text file with text: INPUT(libc++.so.1 -lc++abi) So ...
1
vote
1answer
348 views

Is it possible to download from link file from a web directory?

Suppose there is an instance of apache whose web directory is: /var/www/html Is it possible to create a link from a file in a distinct directory so that a web user can download that file using the ...
12
votes
3answers
14k views

How to find all symbolic links pointing to any file/directory inside a given directory

On this question or on this one (for example) you will get solutions on how to look for symlinks pointing to a given directory (let's call it /dir1), while I am interested to symbolic links possibly ...
1
vote
1answer
444 views

Why ln -s copied a file instead of linking it?

Please see the screenshot. For two times I have run ln -s and it creates a copy of a small text file instead of linking it. The exact command I have run is: lobianco@lobianco-officeLaptopLatitude:~/...
2
votes
1answer
204 views

While portion of udevadm list do I capture for rules

I did: udevadm info -a -n /dev/ttyUSB0 as I'm trying to make a symlink rule for an arduino. The problem is, I'm not sure which of the sections in the output to use for the rules. The first time I ...
1
vote
0answers
511 views

Access files from one cpanel account to another

I have a server which has CloudLinux installed with cpanel and whm. On this server I have 2 cPanel accounts, ABC1 and ABC2. I want ABC2 to access files in ABC1? I created a link using SSH WinSCP, ...
0
votes
3answers
2k views

any way to mv a file without touch symbolic links

My motivation to ask this question is the following, one purpose of creating a symbolic link is to save space, but a simple mv command to move a directory elsewhere moves everything to the target ...
1
vote
1answer
7k views

Why is /etc/localtime a symbolic link?

as all know , in order to set new TIME ZONE need to perform the following steps example when we want UTC time unlink /etc/localtime ln -s /usr/share/zoneinfo/UTC /etc/localtime so we create ...
4
votes
1answer
6k views

accessing path from outside the root with symlink

I need to add an outside path to my apache configuration. (httpd) so, I made a symlink to this path in my httpd root folder, the path is: /var/log/httpd/ (I want to display logs directly in my ...
3
votes
3answers
9k views

Create link between two existing files

For example: I have file a.txt and file b.txt. I want a link from a.txt to b.txt. If I open/read file a.txt, file b.txt should open/read. If I try something like ln -s a.txt b.txt I get an error ...
3
votes
3answers
1k views

How to Avoid Many Levels of symlinks with this find?

I know the thread and try to fix my find with -mindepth 15 unsuccessfully find -L $HOME -type f -name "*.tex" \ -exec fgrep -l "janne" /dev/null {} + | vim -R - Unsuccessful attempt find -L $...
1
vote
1answer
866 views

Colour-coordinate symlinks/softlinks based on where they refer to

Is there any way to colour coordinate symlinks/softlinks based on where they're linked, or maybe by who they 'belong' to (similarly to colouring the output of ls for example)? To give you an example ...
1
vote
0answers
181 views

LXC: shared folder in guest machine doesn't work as expect

Host machine has the following dirs: /srv/releases/A/db/DB1/ /srv/releases/A/db/DB2/ /srv/releases/A/files/ /srv/releases/B/db/DB1/ /srv/releases/B/db/DB2/ /srv/releases/B/files/ /srv/current - ...
1
vote
1answer
157 views

realpath -L vs -P

From coreutils manual -L --logical Symbolic links are resolved in the specified file names, but they are resolved after any subsequent .. components are processed. -P --physical Symbolic ...
2
votes
1answer
4k views

Moving application to another folder

I installed an application (Matlab) in it's default location /usr/local/MATLAB a symlink to the executable was created by the installer itself in /usr/local/bin I then notice that my root partition is ...
7
votes
2answers
10k views

How to change the Symlink permission?

I have a issue: I need to change the permission of the symlink from 777 to 755 and I do not have any idea how should I do it. I have tried using the chmod command but it's not working. I want ...
1
vote
4answers
2k views

Why change the current directory to the parent directory of a relative symlink before creating it

From the manual of coreutils, for ln When creating a relative symlink in a different location than the current directory, the resolution of the symlink will be different than the resolution of ...
-2
votes
1answer
64 views

Usage of options for symlinks in coreutils

From coreutils manual 2.10 Traversing symlinks The following options modify how chown and chgrp traverse a hierarchy when the --recursive (-R) option is also specified. If more than one of ...
5
votes
2answers
5k views

Does `ln -sf` overwrite existing files which are only symbolic links

From the coreutils ln manual: Normally ln does not remove existing files. Use the --force (-f) option to remove them unconditionally, the --interactive (-i) option to remove them conditionally, ...
2
votes
2answers
215 views

How to Find All .tex Files in Directories in Recurse Grep?

I want to expand the recursive search of symlinks to include only .tex files find . -type l -name "Math*" -exec grep -d "recurse" word {} +. Failed pseudocode 1 find . -type l -name "Math*" \ -exec ...
1
vote
0answers
32 views

Unix/Windows dualboot OS-dependent file

I'm currently in a dualboot setup, where I work in both Windows and Debian. I've set up my Android development environment to share as many files as possible to save drive space, including my ...
0
votes
2answers
1k views

rsync --link-dest not working as expected with symlinks

I'm using rsync to backup some of my files: rsync -aEN --delete --link-dest="$CURR/" "$SOURCE/" "$NEW/" The --link-dest option works fine with most files, but not with symlinks. When I was writing a ...
2
votes
2answers
743 views

check if there is a link from the current file

How can I check if there is a link from the current file on Linux? Say, I have: touch foo ln -s foo bar ll foo bar bar -> foo foo Now, I want to know, if there are any file linked from foo:e.g. ...
2
votes
1answer
2k views

Use a symbolic link to redirect?

Is it possible to set up a symbolic link such that cd called on the link redirects to the linked path? Kind of like this: $ ln /A/B /B/C $ cd /A/B $ pwd /B/C $
3
votes
1answer
1k views

How to Relink these symlinks after moving the system?

I moved my filesystem and symlinks from Ubuntu 14.04 to 16.04 by using FAT32 memory card, which apparently broke those links; stopped using BitTorrentSync. Differential condition is that those links ...
4
votes
1answer
3k views

Removing file and its sym links

If I create a file and symlink to it e.g touch "example" ln -s "example" "link_example" and use rm example the symlink is still there. How can I delete file and all symlinks that points to that ...
2
votes
0answers
48 views

Mounting USB stick in place of HDD

I'm currently working on a raspian automated box. I've connected an HDD Drive to use as a Samba server and the download and temp folder for the transmission client installed. As the HDD is noisy (and ...
1
vote
1answer
2k views

Can I replace a directory with a symlink without write permissions in parent?

I would like to replace a directory with a symlink. For the directory itself I have full permissions (rwx), but for the parent directory I don't have write permissions (r-x). Is this possible? The ...
1
vote
3answers
215 views

ln -s $SOURCE/* except - with find?

I want to do a symbolic link from all directories and files in the first node of $SOURCE to $HOME/Destination/. Pseudocode ln -s $SOURCE/* exceptThese $HOME/Destination/ Proposal find $HOME ! -...
8
votes
3answers
2k views

ln -s: from one source to many destinations

Pseudocode ln -s $HOME/file $HOME/Documents/ $HOME/Desktop/ where I want to create a symlink from the source to two destinations. Probably, moreutils and pee. How can you create many symlinks ...
0
votes
1answer
304 views

Inside a linked folder, doing “ls” to relative paths outside it shows the contents pointed by linked directory, not the source. Is this correct? [duplicate]

Suppose this directory structure: /folder1/ /folder2/ Now, if I enter cd /folder1 ln -s /folder2 linkToFolder2 cd /folder1/linkToFolder2 ls .. I thought that, given that pwd is /folder1/...
0
votes
1answer
57 views

How to Prevent Dropbox Access Elsewhere when Symlink?

I have the symbolic link ln -s $HOME/BTsync/masi/ $HOME/Dropbox/ I notice that contents in Dropbox GUI on Internet Browser are in conflict where masi directory has old files. I delete the directory ...
2
votes
2answers
7k views

too many levels of symbolic links in /usr/bin — disaster?

I was recently trying to resolve an issue regarding a mismatch in the version of my java jre and java compiler, so I tried something suggested in this answer, which seemed to be relatively harmless, ...
1
vote
0answers
94 views

Copy directory tree, changing the target of absolute symbolic links

I wondered if there's an easy way to copy, scp, pipe tar, etc. host1:/base1/dir1 to host2:/base2/dir1. Other than the base directory, all the directory structure should be identical. `host1:/base1/...
4
votes
1answer
3k views

Get the canonical path for a command

I'm writing a script that needs canonical path of certain commands. Since there could be symbolic links pointing to the actual commands, I use readlink -f to get the canonical path. But I'm not ...
1
vote
1answer
142 views

Full system backup with dd include symlinks

I'm really new in unix and Linux and just tried to learn something. My question is how can I make full system image/backup with dd include symlinks? Is dd good or I should use another approach? Can ...
2
votes
1answer
135 views

Is there a purpose to a symbolic link that points back to the directory containing it?

When Gogs docker installation is run it creates a symbolic link /data/git/git that points back to the parent folder: lrwxrwxrwx 1 1000 1000 9 May 13 19:37 git -> /data/git I'm ...