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

learn more… | top users | synonyms (1)

2
votes
2answers
144 views

How to redirect file output to a different directory?

I have a program that regularly outputs files to a directory, let's say /a/b. I am utterly unable to change where these files are outputted. But for me to use them, I must first move them to, let's ...
4
votes
2answers
616 views

Advantage of symlinks over Windows style shortcuts

When I mainly used Windows, to make a shortcut, I could use a regular file detailing where it linked to, with the extension .lnk or .url Now, on Linux, I mainly use symbolic links, which are a ...
1
vote
1answer
61 views

Should I use hardlinks for my “sites-enabled” folder instead of softlinks?

Every article I find about web servers suggest creating a sites-available and sites-enabled directory within apache/nginx/etc. Then, using symbolic (soft) links, create a link from the available to ...
1
vote
1answer
31 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 ...
0
votes
0answers
22 views

Querying soft links to a file - non-bruteforce method [duplicate]

Is there a way, workaround to find out how many symlinks are pointing to a file? I know the find method, but this will look up all the files. Is there a more lightweight solution? Is it possible to ...
3
votes
4answers
635 views

How to diff two folders by inodes

I'm currently using a script to backup files on my computer. In a nutshell, it works like this: rsync --link-dest=$FOLDER/current $SOURCE $DESTINATION However, I think that my script may be ...
3
votes
1answer
147 views

Access a file in PHP through a symbolic link from a user that normally doesn't have permission

I have this website, where if the user submits a form, a python script is executed through a php page, and the python script creates a zip file and should offer it to the user for download through a ...
4
votes
1answer
66 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 ...
35
votes
2answers
4k views

Symbolic link recursion - what makes it “reset”?

I wrote a little bash script to see what happens when I keep following a symbolic link that points to the same directory. I was expecting it to either make a very long working directory, or to crash. ...
1
vote
3answers
36 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 ...
0
votes
1answer
31 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
36 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
1answer
30 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 ...
1
vote
0answers
21 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 - ...
3
votes
2answers
151 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
420 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 ...
1
vote
1answer
18 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 ...
0
votes
0answers
26 views

Compare the options -T, -P and --no-dereference in coreutils

From the manual of coreutils, here are three quotes from three different places, where the first two are from options common to several utilities and the third one is from ln quote 1 -T --no-...
1
vote
2answers
151 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
1answer
30 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 ...
1
vote
1answer
607 views

How does apache determine what directory to show from public_html?

I am using Ubuntu 12.04 and have configured apache to serve from ~/public_html. I am trying to serve some directory contents over http on LAN. When I did the following: ln -s ../Videos/android-...
2
votes
2answers
87 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 ...
2
votes
1answer
167 views

Wikilink to a symbolic link in ikiwiki

I am running an ikiwiki for my personal use on my laptop via apache2 (os: ubuntu 10.04). If I want to make a link to a local pdf-file I put the file into my scrdir and use the usual wikilink syntax. ...
1
vote
0answers
14 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 ...
1
vote
1answer
177 views

apache Virtual Host Configuration CentOS7

My host machine is Windows 7 and guest machine is CentOS 7. I am a new to Apache and I am trying to create VirtualHost on CentOS7. I have read a lot of documentation and a lot of answers over ...
2
votes
2answers
90 views

Add trailing slash in bash completion of directory symbolic links

I have a symbolic link for a directory, e.g ln -s /tmp /xxx Now when I type /xx and press tab key, bash would complete the line to /xxx If I press it again it become /xxx/ Now, how can I ask bash ...
7
votes
1answer
867 views

sshfs breaks symlinks from SFTP server

Does anyone know how to mount a remote SFTP path via SSHFS so that you can work with symlinks? When I do this, all the symlinks I create point to the wrong files (not the ones I linked to.) All the ...
4
votes
1answer
169 views

Where is information about hard/soft links stored?

Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced ...
1
vote
1answer
864 views

apache symlinks and dokuwiki

I am running a dokuwiki on an apache webserver. Usually I put media files into the directory /var/lib/dokuwiki/data/media. However, to be more flexible and to save disk space, it would be nice to use ...
1
vote
1answer
165 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 ...
2
votes
2answers
91 views

Something like a symbolically linked file, but with change details attached?

Is there a file type or method for using files in which certain files look and behave like symbolically linked files, but contain extra meta information for changing the data when they are read? ...
0
votes
2answers
65 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
44 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....
3
votes
2answers
3k views

How do I see what symlinks exist for a given directory?

I want to do some housekeeping in a directory, and I want to see if a given directory has any symlinks pointing to it. I can easily enough see what directory a symlink points to, but now I want to see ...
5
votes
1answer
173 views

Can GNU Stow use a stow directory that is a symbolic link?

Consider this script. #! /usr/bin/env bash mkdir -p target mkdir -p mydir/package/ touch mydir/package/file ln --symbolic mydir stow file stow stow --verbose --dir=./stow --target=./target package ...
3
votes
1answer
33 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
59 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 ...
1
vote
1answer
32 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 ...
2
votes
0answers
27 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 ...
7
votes
4answers
17k views

Why change the owner of a symbolic link in linux?

In linux it's possible to change the owner or the group owner of a symbolic link (symlink). I was wondering why someone would want to do that, since permissions of a symlink are not used when ...
0
votes
0answers
61 views

Home folder GONE

Suddenly some of my files are not showing up in the browser. I decide to reboot and come back to a totally default home screen and home folder (all my files are gone). When I go to /home and type ls -...
1
vote
3answers
32 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 ! -...
7
votes
3answers
353 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
16 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
28 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 ...
38
votes
3answers
37k views

How can I edit symlinks?

My basic understanding of a symlink is as a special file, a file that contains a string path to another file. The kernel's VFS abstracts a lot of that away but is there any reason why symlinks seem to ...
2
votes
2answers
109 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
21 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/...
0
votes
0answers
19 views

How to create symlink USB to COM port

I need help to create the udev rule. I need my my USB printer to be located as COM1. lsusb ouput: ‍Bus 001 Device 005: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel Adapter‍...
1
vote
1answer
81 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 ...