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)

5
votes
5answers
730 views

How to see the end of a long chain of symbolic links

Suppose I have a link that points to another link that points to another link, etc. way down the line. I'm not sure how many levels of links there are. What's the slick command line way to see the ...
5
votes
2answers
3k views

Symlink to current folder as absolute path without typing whole path

Symlinks are saved shortcuts for relative paths: ~/foo➤ ln -s . ~/bar/foo ~/foo➤ ls -l ~/bar total 8 lrwxr-xr-x 1 me me 1B 15 May 14:38 foo -> . The file ~/bar/foo is a symlink to bars ...
5
votes
1answer
763 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 ...
5
votes
3answers
1k views

Are world-readable/writable/executable links in /usr/bin security holes?

% ls -l /usr/bin/edit lrwxrwxrwx 1 root root 3 Jan 10 05:54 /usr/bin/edit -> vim* This seems to ...
5
votes
1answer
167 views

No performance increase on I/O intensive operation after symlink to ramdisk

We have a system that transforms a set of several thousand multi-MB files. After every step in the transform, it writes the intermediate file to disk. The concept is similar to a scratch disk. We ...
5
votes
1answer
1k views

How to properly create symbolic link?

scenario : I'm in a place that is not in PATH I have a file name dofoo that is executable I want to create symbolic link in /usr/bin that points to dofoo in current directory quite hard to get the ...
5
votes
2answers
4k views

How can I make git commit files in a symlinked folder

I have two folders: /home/me/code/project/ /srv/www/projectfiles/ In the /home/me/code/project folder, I have symlinked static to /srv/www/projectfiles/ i.e. /home/me/code/project/static/ -> ...
5
votes
1answer
2k views

How to find all symbolic links to a given file/directory?

How can you find all symbolic links to a given file / directory? This previous question only applies to hardlinks (if I read correctly).
5
votes
4answers
10k views

Sharing an external hard drive in Ubuntu using Samba

/media/MYDISK is where my hard drive is mounted automatically. I created a symlink using: ln -s /media/MYDISK /home/camilo/MYDISK chmod 777 /home/camilo/MYDISK I'm setting up smb.conf like this: ...
5
votes
2answers
5k 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 ...
5
votes
1answer
2k views

No symlinks allowed in smb share

I have the following share setup on my Ubuntu machine # From /etc/fstab //192.168.1.13/media /home/USER/SHARE/media cifs username=USERNAME,password=PASSWORD,_netdev,uid=USER,gid=users 0 0 However ...
5
votes
2answers
373 views

Windows 7 cross-volume symlinks affecting recycle bin

Related to this question but not identical. Scenario: C:\Folder\Symlink\ is a symlink pointing to E:\Folder\Folder\Target\ Problem: Deleting a file through C:\Folder\Symlink\* bypasses the Recycle ...
5
votes
5answers
18k views

Windows Server 2008 Create Symbolic Link, updated Security Policy still gives privilege error

Windows Server 2008, RC2. I am trying to create a symbolic/soft link using the mklink command: mklink /D LinkName TargetDir e.g. c:\temp\>mklink /D foo bar This works fine if I run the command ...
4
votes
4answers
7k 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 with, for example, to Java's ...
4
votes
2answers
69 views

How do I get cd to switch to the full path when following symbolic links?

How can I get the shell to understand the full path after following a symbolic link. In the example below I'd like the first "pwd" command to report "/Users/sholden/Projects/PS1/examples", and the "cd ...
4
votes
1answer
855 views

Symlink to .vimrc on windows makes file readonly upon write. Why?

I've put my .vimrc file in a central location (dropbox folder, also a hg repository). Under Windows 7, I've symlinked to it from my home folder (strangely enough I had to do it as an administrator, ...
4
votes
1answer
939 views

How do I figure out if a link is a symbolic link, a hard link, or a directory junction in Windows?

If I've created a directory link via mklink, how can I figure out if it was a symbolic link, a directory junction, or a hard link (ie whether I used /d, /j, or /h)?
4
votes
2answers
3k views

NTFS symlinks in linux

I have an NTFS formatted drive (from a previous windows installation) and it contains some symlinks (reparse points), For some reason, I can't do anything with these symlinks: I can't go to where ...
4
votes
2answers
3k views

How to change a symbolic link to a directory to another target?

# ln -sv /path/to/target /path/to/link ‘/path/to/link’ -> ‘/path/to/target’ Now I want to replace that target with target2: # ln -sfv /path/to/target2 /path/to/link ‘/path/to/link/target2’ -> ...
4
votes
2answers
4k views

Give Access to a Subdirectory Without Giving Access to Parent Directories

I have a scenario involving a Windows file server where the "owner" wants to dole out permissions to a group of users of the following sort: \\server\dir1\dir2\dir3: Read & Execute and Write ...
4
votes
1answer
323 views

Unix: softlinks, hardlinks

I am somewhat confused what the differences between a softlink, and a hardlink are (on unix). It seems like a softlink is the same as a shortcut in windows or an alias on Mac OS X. (Can someone ...
4
votes
1answer
3k views

NFS: too many levels of symbolic links. How to find and fix?

wim@wim-desktop:/media/data/dots/manouche$ ls > /dev/null ls: reading directory .: Too many levels of symbolic links wim@wim-desktop:/media/data/dots/manouche$ find . -type l -exec ls -l {} \; ...
4
votes
1answer
144 views

Fun with symbolic links and `notepad.exe` (replacing default notepad application in Windows 7)

I'd like to change my default notepad program from notepad2 to notepad++ (but my question is more complicated than just that so please don't stop reading!) When making the change from notepad to ...
4
votes
2answers
302 views

How to move target a Windows shortcut points at and allow existing shortcut work?

I would like to do the following: Create a shortcut to a folder (say mLink.lnk --> C:\tmp) This will be emailed to users Move and/or rename the folder (C:\tmp --> C:\tmp2) Setup intermediate step ...
4
votes
1answer
1k views

How can I set a Removable External Device as a built-in Hard Drive?

I am using SSD with my laptop and running out of free space.. So I bought an 64GB microSD card as a secondary storage. But, when I launch My Computer, the SD card drive is recognized as, of course, ...
4
votes
2answers
270 views

Hard/SymLinks and Alternate Data Streams

An interesting thought just occurred to me while thinking about NTFS. NTFS supports hard links, symbolic links, and Alternate Data Streams. Is it possible for an ADS to be a link to another file? ...
4
votes
1answer
242 views

What kind of links (symbolic, hard, junction pts…) for multiple cloud backups?

Google-Drive's MS-Windows software doesn't follow links of any kind. Dropbox and Skydrive both - apparently, follow links. I am using MS-Windows7 64-bit professional edition. What I did was to move ...
4
votes
1answer
2k views

Checking where a symbolic link points at in Windows 7

In Windows 7, how can I check if a file is a symbolic link or not, if a folder is a junction or not, and how can I check where they are pointing at (in case they are symlink/junction). Both in ...
4
votes
1answer
1k views

Why is chattr and lsattr resulting in “Operation not supported while reading flags”?

I'm getting the following error: $ lsattr /etc/rc.local lsattr: Operation not supported While reading flags on /etc/rc.local $ sudo chattr +i /etc/rc.local chattr: Operation not supported while ...
3
votes
4answers
5k views

Symlink to a URL

Is there any way to create a symbolic link to a URL? Update: I need to symlink it to an HTTP URL. Update: The reason I want to do this is so that I can move this symlink to another computer without ...
3
votes
2answers
4k 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 ...
3
votes
2answers
122 views

One line ls command to display symbolic links

How can I use just one single ls command to display all symbolic links in my /dev directory? I know ls -l and that's about it.
3
votes
2answers
4k views

How to fix a symbolic link pointing to a wrong location?

I'm a little bit confused with hard/softlinks here. I'm on OSX, have a folder '4' and two links pointing to it: drwxr-xr-x 4 imm staff 136 14 Jun 21:24 4 lrwxr-xr-x 1 imm staff 1 14 Jun 16:56 ...
3
votes
3answers
426 views

How to know the level of a symlink in linux?

For example, if a symlink a -> b b -> c c -> d say, the symlink level of a is 3. Then, is there any utility to get this info? And, also I want to get the expansion detail of a symlink, ...
3
votes
3answers
2k views

Check if two paths are pointing to the same file

I've got a script to recursively create symlinks in my home directory to my settings directory, to keep the files under version control. I would like it to skip files which are already symlinked via a ...
3
votes
2answers
1k views

How to mass remove symbolic links in Windows (amongs regular files that share similar name in many folders)?

Is there anyway to quickly remove many symbolic links in many folders that contains many other files. E.g some command in command prompt (be able to delete all slink created from day XX for example)? ...
3
votes
1answer
651 views

In OS X how could I create symlinks to everything within a given directory (rather than the directory itself)?

Say I have a bunch of config files that I'd like to store elsewhere, but if I move them and then symlink the directory, the application sees it as a symlink and won't use the contained files. Instead ...
3
votes
2answers
3k views

How to run a symlink pointing to an executable in terminal (Linux)

I installed NodeJs on an Ubuntu machine, and the package have been installed as nodejs. Now, to run it as node, I created a symlink: sudo ln -s /usr/bin/nodejs /usr/bin/node This will work if I ...
3
votes
1answer
3k views

Create Symlink in Windows from command line without “.lnk”

I want to mount a network share on a folder in Windows, because I have an application that's stored big files in a hard-coded path (e.g. c:\path\of\directory). I can't change that path. This is ...
3
votes
3answers
188 views

Direction of a symlink

touch a ln -s a b The above command creates a symbolic link which originates from "b" and points to "a": lrwxrwxrwx 1 root root 1 Dec 20 23:41 b -> a The question is that how to say that ...
3
votes
3answers
20k views

How can I create a directory symbolic link on Windows Server 2003?

I'm trying to create a directory symbolic link under Windows Server 2003 but I'm not having any luck. I've tried junction.exe (Sysinternals), ln.exe, and linkd.exe (Windows Server 2003 Resource Kit). ...
3
votes
1answer
150 views

Editing softlinked files in UNIX

Let's say I have file A, and using 'ln -s A B', I have B. When I open, edit and save B, now B is not symlink anymore. It's just a new copy of A. Is this expected behavior? I use Mac OS X, and I ...
3
votes
1answer
527 views

Hard symbolic link directory

I am taking over control of a server and I have found a directory in two different locations: /var/www /home/user.name (i.e., ~/) that have the exact same inode number: ls -i 11895253 ...
3
votes
1answer
5k views

Can somebody explain this `ln -s` command to me?

The command in question is: sudo ln -s /usr/lib/x86_64-linux-gnu/foo.so /usr/lib/ I read this article about ln, which indicates that the latter argument can be either a name or a directory. In this ...
3
votes
2answers
841 views

How to stop following symlinks in dropbox

What I have: Dropbox\ projects\ serverfault\ stackoverflow\ superuser\ currentProject -> projects\superuser [Sometimes I change it to other project] When I sync ...
3
votes
1answer
4k views

How do I make a symbolic link on Windows 7?

I've recently changed from Ubuntu to Windows 7. One feature I'm struggling to develop without, is symbolic links. In linux, I would simply ln -s /where/to/ /where/from/ I've done some googling for ...
3
votes
1answer
8k views

Using symbolic link directories with Apache, PHP and Windows 7

I am trying to setup a symbolic link for a directory and I am getting the strangest error. I am using: mklink /d C:\www\site\inc C:\inc where C:\inc\script.php is the file I need to run. This ...
3
votes
2answers
252 views

Aren't egrep, fgrep supposed to be aliases to grep?

Since egrep is essentially grep -E I would expect it to be an alias that calls grep with that option. However on my system file `which egrep` shows it is an executable. Also egrep as an alias only ...
3
votes
1answer
122 views

Find symlink when 'find' hasn't worked

So I have a few utility scripts in my ~/scripts folder. They are all bash scripts, nothing amazing about that. One is named sfind.sh, the other is svn-add-all.sh. At some point, I created symlinks to ...
3
votes
1answer
103 views

Is there any danger in removing '.' components from a path?

Can the transformation of a path A/./B into A/B change the meaning of the path? I am aware that the path A/foo/../B may not refer to the same object as A/B, due to symbolic links (if foo is a ...