A symbolic link ("symlink") is a reference to a file or folder which may exist on the same or another drive in the system. Symbolic links allow users to create a more logical file layout, when the files themselves may be spread across multiple disks or relocated to more convenient locations.

learn more… | top users | synonyms (1)

160
votes
1answer
76k views

“directory junction” vs “directory symbolic link”?

MKLINK [[/D] | [/H] | [/J]] Link Target /D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a symbolic link. /J ...
140
votes
6answers
121k views

How can I delete a symbolic link?

I created a symlink using mklink. Now I need to change it but I can't figure out how to delete it so I can recreate it correctly.
130
votes
6answers
121k views

chown is not changing symbolic link

I'm trying to change the user/group of a symbolic link with the command: $ chown -h myuser:mygroup mysymbolic/ But it's not changing. I'm logged in as root. The current user/group is set to ...
77
votes
7answers
122k views

How to copy symbolic links?

I have directory that contains some symbolic links: user@host:include$ find .. -type l -ls 4737414 0 lrwxrwxrwx 1 user group 13 Dec 9 13:47 ../k0607-lsi6/camac -> ../../include 4737415 ...
60
votes
4answers
108k views

How to remove a symbolic link to a directory?

I made a symbolic link with the following commmand: ln -s ../test5 I want to remove it now but my rm fails: $ rm -Rf test5/ rm: cannot remove `test5/': Not a directory $ rm test5/ rm: cannot ...
45
votes
8answers
57k views

How do I create a link in Windows 7 home premium as a regular user? [duplicate]

I am a Linux guy and as such I am very lost when I try and do anything is Windows. I am trying to create the following link: mklink /d C:\backup\data \\myth\backup\data But I do not have sufficient ...
40
votes
3answers
6k views

What are the various link types in Windows? How do I create them?

Is it possible to link two files or folders without having a different extension under Windows? I'm looking for functionality equivalent to the soft and hard links in Unix.
36
votes
1answer
30k views

How do file permissions apply to symlinks?

Let's say you have this structure: + directory -- file1 -- file2 -- file3 -> /tmp/file3 file3 is a link to another file3 somewhere else on the system. Now let's say I chmod 777 the directory ...
34
votes
8answers
55k views

Create a symbolic link in the Mac OS X Finder

Is there a way to get the same functionality as the unix command ln -s in the Mac OS X Finder (OS 10.5)? I want to be able to create symbolic links while working in Finder windows without opening the ...
34
votes
3answers
14k views

Does rm -f follow symbolic links?

I have a directory like this: $ ls -l total 899166 drwxr-xr-x 12 me scicomp 324 Jan 24 13:47 data -rw-r--r-- 1 me scicomp 84188 Jan 24 13:47 lod-thin-1.000000-0.010000-0.030000.rda ...
27
votes
3answers
22k views

How do I create a relative symbolic link in Linux?

I need a symlink that resolves relative to the directory it is placed in. What command is used to create such a thing?
25
votes
3answers
16k views

What is the difference between Symbolic Link and Shortcut?

What is the difference between a Symbolic Link and a Shortcut?
21
votes
4answers
17k views

How to copy symlinks to target as normal folders

i have a folder with symlinks: marek@marek$ ls -al /usr/share/solr/ razem 36 drwxr-xr-x 5 root root 4096 2010-11-30 08:25 . drwxr-xr-x 358 root root 12288 2010-11-26 12:25 .. drwxr-xr-x 3 root ...
19
votes
7answers
21k views

Straightforward, easy way to create symbolic links on Windows?

I need something supported at least on Windows XP and not requiring any new user downloads hopefully.
16
votes
1answer
10k views

Permission to make symbolic links in Windows 7?

How can I grant a particular user the permission to create symlinks in Windows 7? I've searched through "Group Policy" and Google, but haven't found anything. On a side note, is there a way to ...
15
votes
2answers
11k views

View a list of symbolic links on system?

Is there a way to see a list of all the symbolic links that are active on a Windows machine?
15
votes
1answer
22k views

When creating a symbolic link, how do I troubleshoot 'too many levels of symbolic links'?

I'm trying to create a symbolic link on Ubuntu 10.04 it says: me@laptop:~/PHPUnit$ ls assertions.php LICENSE PHPUnit README.markdown build.xml package.xml phpunit.bat ...
15
votes
2answers
23k views

Does Windows7 support symbolic links (folder 'shortcuts')?

I see W7 seems to have more support for virtual folders, that don't correspond to actual directories on the disk. Does it also support proper symbolic links so I can e.g create a symbolic link ...
15
votes
4answers
4k views

Scenario - NTFS Symbolic Link or Junction?

Differences ┌───────────────┬──────────┬──────────┬──────┬───────────┬─────┐ │ │ Absolute │ Relative │ File │ Directory │ UNC │ ...
14
votes
3answers
13k views

Ubuntu + latest samba version, symlinks no longer work on share mounted in windows

I just apt-getted (apt-got?) the latest software for my Ubuntu 9.10 linux box, and I noticed that samba was the included in the update. After the install, the symlinks in my home directory no longer ...
14
votes
2answers
4k views

How to make a symlinked folder appear as a normal folder

I have two Dart applications I need to dockerize. These two apps use a shared source directory. Because Docker prevents adding files from folders outside the context directory (project/app1) I can't ...
14
votes
1answer
2k views

Why can't normal users on Windows create symbolic links?

Beginning with Windows Vista NTFS gained the ability to represent symbolic links to files (as opposed to directory junctions). Also the mklink utility appeared. However, non-administrative users can't ...
14
votes
3answers
9k views

Executing symbolic link to exe - “The specified path does not exist”

When trying to execute a symbolic link which points to an exe file (on Windows 7), the "Open with" windows appears. When renaming it to a ".exe" file, it says "The specified path does not exist. Check ...
12
votes
4answers
8k views

Does window have the ln -s or equivalent?

I need to link a file to c:\Windows\System32\drivers\etc\hosts. How can I do that with windows? Is there a soft link such as 'ln -s' or equivalent in Windows?
12
votes
2answers
371 views

Can a file system's logical structure (including symlink targets) be represented in a single lightweight file (non-binary)?

After playing with multiple SQL and NoSQL databases over the years I feel the best way for me to ensure portability in my personal apps that are data-centric is to avoid all bonafide databases ...
12
votes
4answers
6k views

Any tool to create symlinks in GUI [closed]

I can use mklink, but I am wondering are there any GUI tools available?
11
votes
2answers
2k views

Tab-completion with directories/links

I have this problem with tab-completion in terminal in both archlinux and ubuntu: I have a link which links to a directory named "something" in my home directory. Now when I open a terminal and want ...
11
votes
3answers
35k views

Creating a symbolic link to mapped network drive in Windows

I am having an issue creating a symbolic link on Windows 7 Ultimate. I want to map a folder from a mapped network drive into My Documents. mklink /D "C:\Users\Vegard\Documents\Virtual Machines" ...
10
votes
2answers
11k views

rsync and symbolic links

I want to backup my home directory to an external drive nightly using a cron job to execute rsync. I am unsure of the exact behavior of rsync's symbolic link flags. rsync's -a flag includes the -l ...
10
votes
5answers
16k views

How to allow acces to a symbolic link in my ~/Sites/ for Apache under Mac OS X Lion 10.7.2

I need allow access to a sym-linked directory within ~/Sites from my Apache. I Symlinked the directories like this ln -s ~/path/to/the/source/directory/ ~/Sites/source-link-here Now whenever I fire ...
10
votes
2answers
2k views

When would one prefer a Junction Point (Directory Hard Link) over a symbolic link?

Technically, I get the difference between the two; this is just a usage question. In particular, I want to move some folders off of a smaller hard drive and onto a larger one, but I need to use some ...
9
votes
3answers
19k views

Why can't I make a symbolic link (mklink) even when I'm an administrator [duplicate]

When I run mklink /D "C:\Users\bwilliams\AppData\Roaming\Sublime Text 2" "C:\Users\bwilliams\Dropbox\Sublime Text", I get this error `You do not have sufficient privilege to perform this operation. ...
9
votes
3answers
686 views

Figure out what non-symlink path would be?

On Linux, if I've cd'd around and am now in a directory, is there a way to figure out what the real path to that directory is if I had not used a symbolic link to get there? Consider: $ pwd ...
9
votes
4answers
9k views

How can I find all symlinks in Windows Vista or 7?

I'm looking for a way to search for all the symbolic links on a NTFS filesystem on Windows Vista or 7. It would be even better if I could specify a specific target to see if it has any symlinks ...
9
votes
2answers
7k views

Finding all symbolic and hard links to a file on UNIX

If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?
9
votes
1answer
257 views

When should I use hard links as opposed to soft links?

I'm about to start toying around with mklink but I'm still trying to get a real grip on this whole "symlink" thing. In particular, I've noticed there's two types of links - "soft links" and "hard ...
9
votes
2answers
9k views

How do I change target of symlink in windows

Is it possible to change the target of a symlink or junction in Windows? In Linux it can be modified with: ln -f
8
votes
2answers
27k views

How to find all soft links (symbolic links) in current directory?

Question relates to shell-scripting in bash. How to check with a script which files within the current directory are soft links? In case I have used the wrong term, when I say soft links, I am ...
8
votes
5answers
10k views

Windows 7 / Symlinks - How do I copy a Symlink to a directory?

Is it possible to copy a Symlink to a directory in Windows 7. When I try to copy a symlink'd directory, it tries to deep copy the contents to the location.
8
votes
3answers
9k views

How to create symbolic links to all files (class of files) in a directory?

I would like to create symbolic links (ln -s) to all files (or a class of files, e.g. ending with .bar) in a certain directory. Say I'm in the cwd and type ls ../source/*.bar gives me foo.bar ...
8
votes
1answer
1k views

Convert symlinks to hard links

I'd like to recursively convert soft links to hard links in a directory. I've tried something like this: for f in *; do (mv $f{,~} && ln $(readlink $f~) && rm $f~) done …but it ...
8
votes
2answers
18k views

Using symbolic link in Windows XP

Junction is a good symbolic link tool in XP. However, it's not so easy to use at first moment, ie. only can use command line interface; move/rename target file/folder; got to use 'junction -d ' to ...
8
votes
2answers
6k views

Symbolic links and 7zip

I'm trying to compress a folder into a .7z archive. This folder contains symbolic links to some other stuff outside the folder (both directories and files). Apparently 7zip just archives the link ...
7
votes
5answers
4k views

How do I alias a Homebrew installed Ruby 1.9 gem binary in /usr/local/bin?

Homebrew's Ruby 1.9 ships with rubygems. Doing gem install ... installs files and binaries into some long-winded path. For example, bundler is installed at: ...
7
votes
1answer
13k views

How do you make a symbolic link with a relative path using mklink?

This web page implies that it is possible to make symbolic links with relative paths using mklink. I have tried all sorts of ways to make relative symbolic links, but I always end up with an absolute ...
7
votes
2answers
15k views

Ubuntu: Creating a symlink with network shared folder

I'm trying to create a symlink with a network shared folder (located in a windows sys) from my ubuntu system using the command. ln -s smb://sys-name/www www It creates a link but it says the link is ...
7
votes
2answers
8k views

Linux, can a home directory be symlinked?

I have a second large storage hdd mounted in Ubuntu in /media/storage. I would like my home directories for me and all future users of the system to be located on this storage drive as well. I was ...
7
votes
7answers
2k views

Automatically cycle numerous or large files to the trash

I've been tasked with fixing a vendor's program that, under certain conditions, dumps gigs of junk files into a log directory. It ends up filling users' machines. My task is to figure out how to make ...
6
votes
4answers
3k views

Need to hide a symbolic link without hiding the directory it links to

I created a symbolic link (specifically a symbolic link & not a Finder alias which bash can't follow) to a directory in my home folder using ln -s link $HOME/directory & now I wish to hide the ...
6
votes
5answers
9k views

How to change a symlink in OS X?

How do I change where a symlink points to, without deleting and creating a new one (with ln -s "/path/to/point/to" "/path/where/symlink/is")? When I tried doing that to Java's "Current" symlink, Java ...