A special type of file that references a file or directory.
3
votes
4answers
839 views
Accidental deletion of /lib directory in Fedora 15
I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be ...
2
votes
3answers
226 views
How universal is the -L (dereference symlink) switch of the 'ls' command?
I have some software that, among other things, needs to:
Assess a file's rwxrwxrwx permissions;
Work under every possible flavor of Unix and Linux you can find in the wild.
Currently, it does that ...
11
votes
4answers
3k views
Converting relative path to absolute path
Is there a *nix command to get absolute(and canonicalized) path from relative path(with current path) or symbolic link?
2
votes
1answer
143 views
Wikilink to a symbolic link in ikiwiki
I am running an ikiwiki for my personal use on my laptop via apache2 (os: ubuntu 10.04).
If I want to make a link to a local pdf-file I put the file into my scrdir and use the usual wikilink syntax. ...
2
votes
0answers
84 views
Hard links vs. Soft links: When would you want to use one over the other? [duplicate]
Possible Duplicate:
What is the difference between symbolic and hard links?
Today, my teacher talked about the differences between 'hard links' and 'soft links', but she never really ...
2
votes
1answer
270 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 ...
8
votes
3answers
276 views
Symlink to part of the file?
Is there possible to create file that is just a sub-sequence of bytes from another file, like a symlink, but referencing only part of the file?
1
vote
1answer
649 views
How synchronize two disks (or folders) using symbolic (or hard) links (like rsync)?
I'm searching a tool or a shell script or another program to synchronize two or more folders or disks.
But it differs of rsync tool, because, I don't want to duplicate the missing file, but do a ...
1
vote
2answers
2k views
Executable symbolic link results in “command not found”
I created a symbolic link (yesterday) like this:
sudo ln -s bin/python /usr/bin/prj-python
When I run:
prj-python file.py
I get:
prj-python: command not found
When I try creating the link ...
29
votes
2answers
7k views
Why hard links not allowed to directories in UNIX/Linux
I read in text books that UNIX/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the ...
4
votes
3answers
7k 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 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 ...
4
votes
4answers
3k views
List symlinks in current directory?
This question talks about finding directories in a current diretory. The solution is basically:
ls -d */
That's great but how can I easily list symlinks? Do I have to use something like
find . ...
-1
votes
2answers
662 views
Replace symbolic link which linked to directory target
I want to upgrade tomcat server from 7.0.19 to 7.0.20.
I've already ln -s apache-tomcat-7.0.19 tomcat7 before, so now I need to link tomcat7 to new target using the following command ln -s --force ...
3
votes
2answers
97 views
Symbolic Link local .jpg file to .jpg file on the internet
Is there any way to have a symbolic link that links a local .jpg file to a .jpg file on the internet in a l/unix environment?
8
votes
2answers
679 views
mv a file without breaking a symlink to that file
Is it possible to mv a file w/out breaking a symbolic link to that file?
My initial response to this is no, and I'm working out a script based solution to change the links immediately following the ...
20
votes
3answers
3k views
How can I “relink” a lot of broken symlinks?
I have a directory tree which has a bunch of symbolic links to files under /home... however, I have moved /home to /mnt/home and need a way to "relink" all of the symlinks. Does such functionality ...
2
votes
2answers
559 views
How does /dev/fd relate to /proc/self/fd/?
$ ls -l /dev/stdin /dev/fd/0
lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2
lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0
$ ls -l /dev/pts/2 ...
1
vote
1answer
728 views
Get path of current script when executed through a symlink
I have a utility consisting of a couple directories with some bash scripts and supporting files that will be deployed to several machines possibly in a different directory on each machine. The ...
3
votes
2answers
131 views
ln gives different results when run multiple times
I have this simple script to use with seventh sense (it's a lone wolf gamebook reader/player):
#!/bin/bash
GAME_PATH=$(dirname "$(readlink -f "$0")")
SEVENTH_SENSE_PATH=$(echo ...
1
vote
1answer
479 views
Extended attribute on symbolic link
I'm trying to set some extended attributes on a symbolic link on Fedora 15.
According to setfattr's usage, there is an option -h for such purpose:
setfattr 2.4.44 -- set extended attributes
Usage: ...
2
votes
1answer
1k 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
600 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 ...
2
votes
2answers
509 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
379 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.
4
votes
1answer
633 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 ...
4
votes
1answer
992 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 ...
3
votes
6answers
823 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 ...
4
votes
3answers
3k 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 ...
25
votes
7answers
4k views
6
votes
1answer
246 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
580 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 ...
9
votes
4answers
429 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
675 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
234 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 ...
2
votes
2answers
301 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 ...
9
votes
2answers
601 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
344 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
283 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 ...
4
votes
1answer
4k 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
3answers
1k 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 ...
6
votes
2answers
787 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
197 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
116 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
3k 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
4k 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
661 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
370 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?
