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)

1
vote
2answers
20 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
460 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
37 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
23 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
33 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
21 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
22k 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
14k 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
28 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
38 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
39 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
49 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 ...
90
votes
7answers
31k 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 ...
7
votes
1answer
798 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 ...
3
votes
1answer
30 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
68 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
11k 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
65 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
2k 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
44 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
5k 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
45 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
79 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
83 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 ...
32
votes
4answers
63k 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 ...
3
votes
1answer
24 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 ...
1
vote
0answers
41 views

rsync's “Read-only file system (30)” error

NB: This is a 2-part question: why does an error happen, and how to work around the error. (The two parts are related, inasmuch as the answer to the "why"-question may shed light on the ...
7
votes
3answers
231 views

How can I find out if a relative symlink is internal to a certain subtree or not?

I want to test if a relative symlink points within the subtree of a certain directory. This example would yield false since it points outside the foo directory: /foo>readlink bar ../fie.txt While ...
7
votes
2answers
6k views

Does Windows recognize Linux's symbolic links?

I was just wondering how a Windows system handles symbolic links. My best guess is that it will not recognize them, but I'm not entirely sure. Also, what do Macs do when confronted by one?
11
votes
2answers
17k views

Java location from /usr/bin/java

I'm trying to find my java location within my Linux system and got this [980@b449 ~]$ which java /usr/bin/java [980@b449 ~]$ readlink -f $(which java) ...
1
vote
1answer
820 views

Creating a proFTPd user

I'm setting up a proFTPd server so I can upload files to my webserver, but I've never tried this before. I've installed proftpd, added a user with a home folder: /home/FTP-shared and added /bin/false ...
3
votes
1answer
40 views

How is a symlink represented in a file system vs a hard link?

I want to make sure my understanding of this is correct: Making a Hard link is created another dentry that points to the same inode Making a symlink is creating a completely new file object/inode ...
7
votes
3answers
5k views

ln -s with a path relative to pwd

I'm trying to create a bunch of symbolic links, but I can't figure out why this is working ln -s /Users/niels/something/foo ~/bin/foo_link while this cd /Users/niels/something ln -s foo ...
1
vote
1answer
20 views

Directing old symbolic link to a different location

Example: I created a symbolic link into my /usr/local/bin folder using sudo ln -s ~/Desktop/package/Application/tool1 sudo ln -s ~/Desktop/package/Application/tool2 … I would like to move my ...
0
votes
1answer
25 views

File -> ../../archive/folder/file restore

Hi i'm new to Linux and I need to use it temporary to set up LetsEncrypt. Once complete, I needed to move the /etc/letsencrypt/live/fullchain.pem file into the root dir but i moved the file ...
1
vote
1answer
33 views

Symlink to same directory

I've set up a ftp server for using ftp push on a tv recording page. I've created an extra user for this, who has only access to one directory, which the user is chroot-ed in. But the page does not ...
1
vote
1answer
53 views

copy and symlink mysql to another disk partition

I'm using ubuntu 12.04 and have two disk partition named: /dev/sda and /dev/sdb. my home partition and other programs are in /dev/sda. therefor any work like database benchmark on my mysql databases ...
1
vote
1answer
69 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 ...
5
votes
4answers
6k views

How do I make find follow most, but not all, symbolic links?

My OS and home directory are on an SSD. I store some large files on a hard disk, and symlink from my home directory to the hard disk (eg. ~/Videos/Films is a symlink to /mnt/hdd/Films). I also have a ...
5
votes
2answers
57 views

Installing programs on a removable drive

I am planning to install some software on removable media (which will presumably always be present in the computer, though it's possible that there could be occasions where it is absent). After doing ...
1
vote
0answers
36 views

Bash tab completion not working within symlinked directory

I'm working with Bash 4.2.46 on RHEL7 with the bash-completion packages installed, but I seem to have found an odd corner case where tab completion doesn't seem to work as expected. I have a set of ...
2
votes
1answer
47 views

Automatically add slash when navigating through symlink

I use symlinks a lot and pretty much linked my whole home directory into a folder .other or .dotfiles. When I'm im my home directory and try to got into the folder .config/, its actually a symbolic ...
0
votes
1answer
25 views

get target file size by symlink on cifs share

in shared directory f:/dir on Win2008 absolute symlink created with mklink f:/dir/symlink2file f:/dir/file This share then mounted in Debian with mount -t cifs -o ...
1
vote
1answer
52 views

Symlink to clean up home directory

I'm currently trying to clean up my Mac. I hate it when my home directory (~) is full with config files and stuff I don't want to see all the time (.bash_history, .bash_sessions, etc.). My idea about ...