A special type of file that references a file or directory.

learn more… | top users | synonyms (1)

2
votes
1answer
2k views

Why can't list file/directory relative to .. from a symbolic link directory (No such file or directory)?

I have a /usr/tomcat6/logs directory linked to /var/log/tomcat6. When I changed directory to /usr/tomcat6/logs and try to ls files using a relative pathname ../conf/Catalina/localhost, a No such file ...
3
votes
1answer
763 views

Is there any way to rsync absolute symlinks alone?

I want to sync a big folder hierarchy between two machines. I want to copy the contents of the symlinks if they are absolute, for eg it points to /some/folder/someFile I want to retain the symlinks if ...
4
votes
2answers
703 views

Why is bash completion of a symlink different than a directory?

I usually do a find with an environment variable as the path when searching for source code. Recently I replaced my environment variable with a symbolic link, and it broke Bash's shell completion. ...
1
vote
1answer
430 views

Kdevelop project setup with symlinked files not seeing custom include paths

So I have a crazy project setup (well, it's only 1 file that needs this crazyness). First, I'll explain the setup. So I have a file on my dropbox. I want to include that file in a Kdevelop project, ...
2
votes
2answers
1k views

How to remove the directory a symbolic link links to plus the symbolic link?

Say a is a symbolic link to b. I am looking for a simple command to remove both a and b at once that does not require me to know about b.
5
votes
1answer
1k views

list files by symlink target

How do I get list of files (and then do something with that list) by filtering through the symbolic link target name, and not the symlink name? For example from the following list I'm only interested ...
5
votes
1answer
2k views

Symbolic link permissions

I have access to a remote Linux machine where everytime I create a symbolic link, it is created by default with the following permissions: lrwxrwxrwx If I try to change the permissions of the ...
4
votes
6answers
1k views

Is it possible to “roll” a symlink to a new file without affecting any open file handles?

An application I am developing locally logs it's output to files formatted with the current timestamp such as app-%Y%m%d.log. To make it simple to be able to tail the current's day log in a terminal ...
9
votes
4answers
7k views

Make a symbolic link to a relative pathname

I can do this: $ pwd /home/beau $ ln -s /home/beau/foo/bar.txt /home/beau/bar.txt $ readlink -f bar.txt /home/beau/foo/bar.txt But I'd like to be able to do this: $ pwd /home/beau $ cd foo $ ln -s ...
27
votes
7answers
8k views

What is the difference between symbolic and hard links?

When would you use one over the other?
7
votes
1answer
309 views

Is there a way to make perl -i not clobber symlinks?

A friend of mine points out that if you do: perl -pi.bak -e 's/foo/bar/' somefile when "somefile" is actually a symlink, perl does just what the docs say it will do: It does this by renaming ...
1
vote
1answer
661 views

apache symlinks and dokuwiki

I am running a dokuwiki on an apache webserver. Usually I put media files into the directory /var/lib/dokuwiki/data/media. However, to be more flexible and to save disk space, it would be nice to use ...
10
votes
4answers
779 views

Include / in symlink to a directory?

Symlinking to a directory gives to different results with ls -l depending on whether I ln -s dir or ln -s dir/. But what's the actual difference, and which one should I prefer why?
6
votes
5answers
937 views

Dynamic Symlinks

I have built my app for different architectures and would like to create a "dynamic symlink" which takes me to the right version based on a variable. If the machine I am currently logged in to, is ...
0
votes
1answer
282 views

Keeping multiple root directories in a single partition

I'm working out a partition scheme for a new install. I'd like to keep the root filesystem fairly small and static, so that I can use LVM snapshots to do backups without having to allocate a ton of ...
4
votes
2answers
401 views

Find incoming symlinks

In Linux, what is the best way to find all symbolic links that point to a given file (regardless of whether the symlink is relative or absolute)? I realize this will require scanning the whole ...
13
votes
2answers
1k views

pwd without symlinks

If I do pwd I notice it uses whatever symlinks I used to get into the current directory. Can I get it to tell me the "real" directory I'm in ... i.e. the path from the root to my current directory ...
6
votes
1answer
420 views

Why do some symbolic links affect program behavior?

One thing that has been puzzling me for some time is this: % which halt /sbin/halt % file /sbin/halt /sbin/halt: symbolic link to `reboot' However, executing sudo halt does, of course, not reboot ...
0
votes
1answer
387 views

Inconsistency in behavior of 'rm' when a mounted volume is involved?

If I run the following sequence of commands: mkdir dir ln -s dir link rm -r link/ I get this output: rm: cannot remove `link': Not a directory I get the warning because I could simply have ...
5
votes
1answer
6k views

Make samba follow symlink outside share

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 ...
7
votes
4answers
2k views

How does one atomically change a symlink to a directory in busybox?

I am trying to (as close as possibly) atomically change a symlink. I've tried: ln -sf other_dir existing_symlink That just put the new symlink in the directory that existing_symlink pointed to. ln ...
7
votes
2answers
1k views

Providing /bin and /lib inside a chroot jail

I need to be able to provide the /bin and /lib directories inside a chroot jail so that programs can dynamically link properly. Is there a way to accomplish this without making a copy of the /bin and ...
1
vote
1answer
283 views

Using find to find symlinks that point to a certain pattern of files

I have several directories that all have various symlinks in them. I want find (or another program) to find based on where the symlinks point to. For example this is how it currently works: ...
2
votes
2answers
2k views

How do I see what symlinks exist for a given directory?

I want to do some housekeeping in a directory, and I want to see if a given directory has any symlinks pointing to it. I can easily enough see what directory a symlink points to, but now I want to see ...
9
votes
1answer
128 views

Strategies for maintaining a reference to a file after it was moved or renamed?

I've had a mac at work lately, and was amazed to see that Xcode would still find my latest project after I renamed its folder and moved it someplace else. Now I understand that this is the result of ...
5
votes
1answer
5k views

Copy symlink AND where it points to using rsync

It doesn't need to be done by rsync, but it would be nice not have to write a script to do this, and rsync is very close to what I want. "rsync -a" (or -l) can preserve symlinks, and -L can ...
12
votes
2answers
6k views

Do symbolic links actually make a difference in disk usage?

I've read in so many websites that, in Linux, symbolic links (soft links, symlinks) are just like pointers that reference another file, which may be located anywhere (like Windows shortcuts). However, ...
1
vote
2answers
872 views

Keep tracking of symbolic links?

I use symbolic links quite often, but after moving the original file, I lose track of the symbolic link. I also use symbolic links for keeping track of some files in the same directory, but again, I ...
6
votes
4answers
1k views

Is there a standard symbolic link to the current users home directory?

The shell can expand ~ to your home directory. $HOME usually has the same deal, but often you want to refer to the current users home directory from a context that may not support such expansion. I ...
4
votes
4answers
411 views

Symbolic link and hard link questions

Let's say /A/B/c.sh is symbolic linked to /X/Y/c.sh. If c.sh has the command "./SOMETHING", '.' means /A/B/ or /X/Y/? How about the hard link?