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)

0
votes
1answer
13 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 ...
0
votes
1answer
20 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 ...
32
votes
3answers
31k 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
92 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
20 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. ...
0
votes
0answers
12 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 ...
1
vote
1answer
57 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 ...
0
votes
1answer
33 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 ...
7
votes
1answer
824 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 ...
2
votes
1answer
46 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 ...
9
votes
2answers
5k views

find usage with -L

I have link -> file I do find -L . -name 'link' And get ./link Why is that? man find says: -L : Follow symbolic links. When find examines or prints information about files, ...
4
votes
5answers
453 views

What is a symbolic link made from? Understanding the structure of symlinks

I use Ubuntu 15.10 and I'm very new in Linux. After reading in Wikipedia what is a symbolic link in general, and after executing a symlink creation command in the Ubuntu Unix-bash terminal, I ought to ...
1
vote
1answer
801 views

ldconfig not following user-created symbolic link

I'm attempting to run Inkscape 0.48.4-15 (armv7) which is installed via pacman from Arch Linux ARM. $ inkscape inkscape: error while loading shared libraries: libMagick++-6.Q16HDRI.so.3: cannot open ...
1
vote
3answers
1k views

Why does httpd give an error following a symlink into my home directory on Fedora?

I've just re-enabled an app after OS change. Symbolic link to it is located of course in /var/www/myapp . After changing permissions to 0775 (even 0777 temporary), changing owner to apache:myuser, ...
18
votes
1answer
13k views

How can I access a directory outside a chroot from within it?

I have a user which is chrooted to her home directory, but I want her to also be able to manage files within /var/www. As such, I did the following: root@server:/home/username# ln -s /var/www www ...
3
votes
2answers
33 views

“Junctioned” symbolic links

Does Linux have the capability to use "junctioned" symbolic links? I'm not sure if this is an actual term or not, so let me explain the concept. I have a git repository containing all my ...
0
votes
0answers
39 views

How to create a symbolic link of all files in a directory using a shortened name obtained with using a piped cut on the filename

I have a directory full of libraries (*.so.0.*), and I want to use find to create a symbolic link to each file, named *.so.0. Here is a (non working) try: find $HOME/.local/lib64/ -name ...
5
votes
3answers
586 views

File permissions

I have a PHP script running which makes symlinks. To confirm which user it is: file_put_contents("testFile", "test"); $user = fileowner("testFile"); unlink("testFile"); echo "running as user '" . ...
1
vote
1answer
36 views

Getting symbolic links to behave more like shortcuts in Windows [closed]

I'm trying to launch a game from a symbolic link located on my desktop, but every time I do the game installs all its files onto my desktop. And when I try relaunching the game after moving all the ...
0
votes
1answer
29 views

Why can't I create a symbolic link in /usr/bin?

I'm trying to create a sym link in my /usr/bin directory as the command drush8 But every time I do it, it doesn't show up in /usr/bin but instead says it already exists. It's thinking that it exists ...
1
vote
2answers
29 views

How to work with symbolic links to directories

I am experimenting with symbolic links and I'm encountering a couple issues. The first is how after following a symbolic link to a directory to display the actual working directory instead of the ...
5
votes
2answers
472 views

Create symlink tree in existing directories

I carry all of my music around on a 1TB USB drive and have a udev rule to symlink it to $HOME/Music/ when I plug it in to one of my laptops, which it does. The issue I have is that this works fine ...
0
votes
2answers
40 views

Run a command which returns a string when reading a file [duplicate]

I have this idea and maybe it is not feasible, but I think it worth asking. Let's say a user is running this command: cat ~/file.txt Whenever something tries to read from this file, I would like ...
0
votes
0answers
25 views

Symlink - what i need to know?

I have a Website with a CMS under the folder /var/www/html/mysite My admin made a symlink once, so when you request my URL, you will be redirected to the folder mysite. I have now created a copy ...
0
votes
1answer
51 views

Debian git error: undefined symbol: __gmpn_cnd_add_n

$ sudo apt-get install git $ git clone sth Cloning into 'a-folder'... git-remote-https: symbol lookup error: /usr/lib/x86_64-linux-gnu/libhogweed.so.2: undefined symbol: __gmpn_cnd_add_n ...
0
votes
1answer
25 views

cron not working with commands symlinked in custom PATH

I have a script job.sh in /home/user/scripts, which is then symlinked to /home/user/bin/job. The custom binaries path has been included in .bashrc, so whenever I issue the command job param1 etc from ...
13
votes
2answers
23k views

How do you make samba follow symlink outside the shared path

This is Ubuntu server 10.04 64 and samba 3.4.7. I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one: ln -s /home/temp /home/mit/share/temp But on ...
1
vote
2answers
17 views

Is there a way to not create a sym link if the folder exists

I have something like folder A and when I do ln -s A a it creates the sym linked folder a now if I repeat the command ln -s A a I get the dead link a/A Is there a way that I can have ln fail if ...
21
votes
3answers
15k views

Determining if a file is a hard link or symbolic link?

I'm creating a shell script that would take a filename/path to a file and determine if the file is a symbolic link or a hard link. The only thing is, I don't know how to see if they are a hard link. ...
0
votes
1answer
31 views

How could I quickly find a recursive symbolic link? [duplicate]

I am experiencing an issue with a indexing program running much longer than expected. I want to rule out the possibility of a recursive symbolic link. How could I find a symbolic link that is ...
0
votes
3answers
41 views

Are symlinks in sync with the parent file all the time?

I have a log file which is having a ownership for only root. This file consists of active incoming logs & is continuously updated any time. I need to create a symlink for this file and change the ...
1
vote
2answers
42 views

Solaris tar: “symbolic link failed: Not a directory”

When unpacking a tar archive with a symlink under Solaris 10, I get this error: tar: lib/jre/: symbolic link failed: Not a directory The lib/jre symlink points to lib/jre1.8.0_46 which is in the ...
1
vote
1answer
57 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 ...
91
votes
7answers
32k views

Why are hard links to directories not allowed in UNIX/Linux?

I read in text books that Unix/Linux doesn't allow hard links to directories but does allow soft links. Is it because, when we have cycles and if we create hard links, and after some time we delete ...
3
votes
1answer
38 views

Is it safe to make symbolic links in /root to config files in a a users home directory?

Does symlinking from /root to a configuration file in a users home directory bad practice security-wise? For example I currently have /root/.vimrc symlinked to ~/.vimrc Is it a viable attack to make ...
0
votes
0answers
11 views
0
votes
0answers
27 views

File and folder size using ls and du [duplicate]

I created a folder and copied a 992 byte jpg file in it. Then I created a hard and soft links for the file. The hard link is the same size of the file and the soft link is 8 bytes. Now when I checked ...
1
vote
3answers
102 views

Run a shell script via a symbolic link from the directory containing the script itself

My desire is not to change directory then execute. I use a jar file and need to execute that. So I made a very basic shell script to do that. #!/bin/sh java -jar TreeForm.jar Then, I saved it as ...
6
votes
3answers
462 views

How do I get `ls -l` output for a link recursively until reached the original file?

Let me give an example (it's just an example taken from here): $ ls -l /usr/bin/gnome-text-editor lrwxrwxrwx 1 root root 35 Mar 16 2015 /usr/bin/gnome-text-editor -> ...
3
votes
3answers
12k views

Make Nginx follow symlinks

Nginx does not follow symbolic links. I get a 404 error. In my directory, I have this link: lrwxrwxrwx 1 root root 48 Sep 23 08:52 modules -> /path/to/dir/ but the files stored in ...
9
votes
5answers
3k views

How do I get 'realpath' to find my symbolic link?

I am on MacOSX using bash as my shell. I have symbolic link, created like this: ln -s /usr/bin/python python2 I have a package that uses python2 and I want to create a symbol link in my current ...
0
votes
1answer
71 views

Create a symbolic link in the current directory

I have got a question were I have to create a symbolic link named "new" to file /test/test1/test2. The current command I have is this: ln -s /test/test1/test2 /new I am not if there is a specific ...
6
votes
5answers
3k views

Getting relative links between two paths

Say I have two paths: <source_path> and <target_path>. I would like my shell (zsh) to automatically find out if there is a way to represent <target_path> from <source_path> as ...
1
vote
1answer
65 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 ...
18
votes
3answers
6k views

Convert absolute symlink to relative symlink with simple Linux command

I have a complete sub-filesystem inside a path /home/user/system containing the standard Linux structure with directories /bin, /home, /root, /usr, /var, /etc,... This sub-filesystem contain symbolic ...
0
votes
2answers
53 views

How to prevent symlink from creating within itself?

Running the following command works as expected, creating a symlink to src from include/bb: ln -sf ../src include/bb However, calling the same command again will cause an additional symlink to src ...
2
votes
2answers
2k views

How do I dereference links when extracting from a tar file?

If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be ...
1
vote
1answer
81 views

Why is /bin a symbolic link to /usr/bin?

According to the Filesystem Hierarchy Standard the /bin directory should contain utilities needed in single user mode. In practice, many Linux distributions make the directory a symbolic link to ...
0
votes
0answers
100 views

Symlink not working for /opt folder

I am in the midst of installing Java on red hat machine. So I downloaded jre-1_5_0_10-linux-i586.rpm and copied it into /opt/local. Then I ran sh ./jre-1_5_0_10-linux-i586-rpm.bin and finally I ...
33
votes
4answers
66k views

How to get full path of original file of a soft symbolic link?

I want to scp a file to a server. The file is a symbolic link, and actually what I want to do is copying the source file. Anyway I don't want to track source file's path manually, because it can be ...