Questions tagged [symbolic-link]

220 questions
233
votes
4 answers

Symlink not updating as expected when using an absolute with relative path

I am trying to use symbolic links. I did some reading and found the following commands: Creation -> ln -s {/path/to/file-name} {link-name} Update -> ln -sfn {/path/to/file-name} {link-name} Deletion -> rm {link-name} Creations and deletions work…
Jérôme Verstrynge
  • 4,787
  • 7
  • 24
  • 35
143
votes
9 answers

Find out symbolic link target via command line

Say that I setup a symbolic link: ln -s /root/Public/mytextfile.txt /root/Public/myothertextfile.txt is there a way to see what the target of myothertextfile.txt is using the command line?
Jared
  • 1,577
  • 3
  • 12
  • 12
119
votes
8 answers

How do I create a symbolic link in Windows?

Windows Vista added the ability to create symbolic links to files and directories. How do I create a symbolic link and what are the current consumer and server versions of Windows that support it?
cowgod
  • 3,500
  • 6
  • 28
  • 20
101
votes
3 answers

Perform rsync while following sym links

I have a directory that contains symbolic links to other directories located on different media on my system: /opt/lun1/2011 /opt/lun1/2010 /opt/lun2/2009 /opt/lun2/2008 /opt/lun3/2007 But the symbolic links show up…
ensnare
  • 2,212
  • 7
  • 24
  • 40
45
votes
2 answers

how to update a symbolic link target (ln -f -s not working)

I'm using ln -f -s /var/www/html/releases/build1390 app-current to update symbolic link "app-current" with a new destination. However, this doesn't work, the link "app-current" keeps it original destination, however, I don't get any…
solsol
  • 1,121
  • 8
  • 21
  • 31
44
votes
4 answers

How to list symbolic link chains?

Given this example: mkdir a ln -s a b ln -s b c ln -s c d If I execute: ls -l d It will show: d -> c Is there a way for ls or any other linux command to show d -> c -> b -> a instead?
Kalecser
  • 543
  • 1
  • 4
  • 5
32
votes
6 answers

How to create a symbolic link without using ln?

I deleted a critical symbolic link - libc.so.6. I have the file it should point at, but the basic commands such as ln or wget won't work anymore due to the link missing. However, echo or other Bash builtins work. I am looking for a way to recreate…
Sebas
  • 535
  • 1
  • 8
  • 18
24
votes
4 answers

ln -s vs mount --bind

Is there any practical difference between using ln -s or mount --bind? I want to move some folders to another partition, without changing their daemon setting, and wonder what approach I should take. I prefer ln -s as it requires minimum setup (no…
SyRenity
  • 3,179
  • 11
  • 57
  • 79
20
votes
5 answers

Create NTFS symbolic links from within Linux

Is there a Linux utility that can create NTFS symbolic links? That is, a link on an NTFS partition that points to another NTFS folder - one that will work within Windows 7, specifically. I wish to relocate a folder that is normally in-use while…
rymo
  • 513
  • 1
  • 3
  • 13
17
votes
2 answers

Symbolic link and filezilla over sftp

I'm pretty new to debian, and I'm trying to set up a server. I have created a user who can only access his folder /home/username (and its subdirectory). Now I want to use that user for the webserver I set up, and I have given him access to /var/www…
Doc
  • 273
  • 1
  • 3
  • 8
16
votes
1 answer

How do I assign an SELinux label to a symlink with semanage so it persists after a relabel?

My apache DocumentRoot /var/www is a symbolic link to another path. The target has the appropriate file context label (httpd_sys_content_t) so that apache can read it with SELinux enabled. However, the symbolic link itself is labeled with…
Steven T. Snyder
  • 1,113
  • 2
  • 10
  • 19
16
votes
1 answer

How can I prevent rsync replacing symbolic links with new directories in the target directory hierarchy?

I am using rsync(1) to synchronize files between a source area and a target area, where the target directory hierarchy contains symbolic links. When a source directory has the same name and relative path as a symbolic link in the target area, then…
Henry
  • 421
  • 3
  • 7
15
votes
1 answer

How do I find circular symbolic links?

I'm working on a HP-UX system and I want to find if there are any circular symbolic links. So far I'm using the command: ls -lrt `find ./ -follow -type l` But it's only doing ls -lrt on current directory as result. What command should I use to…
Vladimir
  • 153
  • 1
  • 1
  • 4
14
votes
1 answer

Preserving existing destination symlinks with rsync

I am using rsync(1) to keep a local debian repository updated. Recently, the disk I am using to store it started running low on space, so I decided to use symlinks to allow me to move some of the directories to another similar sized…
unkilbeeg
  • 243
  • 2
  • 9
14
votes
1 answer

Force rsync to copy symlink, even if referent does not exist

I am getting this message with rsync: symlink has no referent: "/a/path" Well, rsync is right: in the source filesystem, the (symbolic) link is pointing to a non-existent location. That is intended. The target of the link only exists in the…
blueFast
  • 4,200
  • 13
  • 37
  • 54
1
2 3
14 15