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

learn more… | top users | synonyms (1)

4
votes
2answers
1k views

Trailing slashes on symbolic links to directories

I'm trying to emulate the process of path resolution (see man page path_resolution) in unix-like systems. My OS is Linux with GNU coreutils 8.7. In order to clarify the meaning of extra trailing '/' ...
4
votes
2answers
521 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 ...
4
votes
2answers
857 views

How do I make find follow most, but not all, symbolic links?

My OS and home directory are on an SSD. I store some large files on a hard disk, and symlink from my home directory to the hard disk (eg. ~/Videos/Films is a symlink to /mnt/hdd/Films). I also have a ...
4
votes
2answers
575 views

How to rsync a chroot without breaking symlinks?

I'd like to rsync (backup) a chroot environment from outside the chroot. For that I first make a lvm snapshot of the chroot volume and then run rsync on that. The only problem with this approach: ...
4
votes
5answers
3k views

How to make a variable symlink ? (or something similar)

How can I make a variable symlink that would point to a different location according to the current user? Is it possible? Should I use something else instead? A mount point? How? Here is the problem ...
4
votes
2answers
5k views

How to remove a directory with “Too many levels of symlinks”

I have a bit of an odd problem on a RHEL system. On our systems we have our home directory automounted under /export/home. There are a few exceptions, as I'm experimenting with using gluster for our ...
4
votes
2answers
978 views

Syncing multiple home folders with dropbox and symlinks

To keep multiple computers synced with dropbox I tried the following. Approach A. -Computer 1: Install dropbox, dropbox folder: /Dropbox/ -Computer 1: Create symbolic link in that folder to home ...
4
votes
1answer
303 views

Advantage of symlinks over Windows style shortcuts

When I mainly used Windows, to make a shortcut, I could use a regular file detailing where it linked to, with the extension .lnk or .url Now, on Linux, I mainly use symbolic links, which are a ...
4
votes
3answers
256 views

File permissions

I have a PHP script running which makes symlinks. To confirm which user it is: file_put_contents("testFile", "test"); $user = fileowner("testFile"); unlink("testFile"); echo "running as user '" . ...
4
votes
2answers
242 views

Force Bash 4 'globstar' option to ignore symlinks

Bash 4 has a fantastic option called 'globstar' that emulates (i.e. was stolen from) zsh's ** syntax for globbing across multiple directories. However, it's somewhat crippled (for my usage, at least) ...
4
votes
1answer
113 views

How do I batch-export all the content contained in symbolic links? (and then delete them all)

So as an alternative to Recursive scp without following links or creating a giant tar file? (this could be an emergency since the remote files could be deleted any time soon), I'm thinking of deleting ...
4
votes
0answers
153 views

Move a file and re-target all of its symlinks [duplicate]

Possible Duplicate: How can I “relink” a lot of broken symlinks? Is there any way to move a file to a new location, and then re-target its symlinks to the new location, using a shell ...
4
votes
0answers
426 views

No access to symlink folder on NTFS partition

I am using an NTFS parition for storing data I like to access both from Ubuntu and Windows 7. On my Ubuntu HOME partition, I like to link the folder Assets in order to access it from an application ...
4
votes
1answer
82 views

read only symlink or something similar? [duplicate]

I created myself a NAT for home use (Ubuntu+Samba+Greyhole+Apache+MySQL+other web server related stuff). 90% of files I store there are pictures that i really don't wanna loose (that's why Greyhole). ...
3
votes
2answers
4k 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
1k views

How could I make multiple symbolic links for multiple directories, conveniently

lrwxrwxrwx 1 deploy users 20 1월 23 18:15 v122 -> /home/files/video122 lrwxrwxrwx 1 deploy users 20 1월 23 18:15 v123 -> /home/files/video123 lrwxrwxrwx 1 deploy users 20 1월 23 ...
3
votes
2answers
156 views

/etc files on a different partition

My setup requires that some of my /etc files reside on a separate partition. For this purpose I've created a softlink: ls -li /etc/group 956 lrwxrwxrwx 1 root root 21 May 7 15:48 /etc/group -> ...
3
votes
2answers
116 views

modify date of symlink on bindfs

I have the feeling that I cannot modify the date of symlinks on bindfs. See the following transcript of what I tried. On EXT4: nailor@needle:~$ mkdir /tmp/ex nailor@needle:~$ cd /tmp/ex ...
3
votes
2answers
834 views

Why is bash giving me (apparently) conflicting information about a file?

Background I am working on a RHEL 5 cluster. I want my Fortran program to read the file /home/bob/inputs/input_1 I asked Bob to give me permission to read all contents of inputs: [bob@server]$ ...
3
votes
2answers
65 views

Is there a way to condense ../.. parts of a path out programatically?

Say for example I have these types of paths to files in a script: /path/to/some/file/../../file1.txt Is there a command I can call such as readlink that will convert this path to its actual ...
3
votes
2answers
126 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?
3
votes
2answers
588 views

Symlink all subdirectories in a directory to another directory

I'm trying to symlink every directory in a folder to another folder. For example, in the structure below, I need the subfolders symlinked to folder2. - /home/chris/folder1 -- subfolder1 -- subfolder2 ...
3
votes
3answers
117 views

cp SOMEFILE .. copies to a different directory after cd'ing via a symbolic link

Consider the following setup: ~/Desktop/Public/subdir ~/Desktop/subdir --> ~/Desktop/Public/subdir (symbolic link) Now I do: cd ~/Desktop/subdir Which leads me into the linked directory. If ...
3
votes
2answers
447 views

Can I make a symlink point to different locations on different machines?

Before you say "no", a workaround would also be fine. Here is the situation: I have two machines local and compile, both including the same ~ over nfs from a third machine files. I would like to have ...
3
votes
2answers
253 views

open a file using CDPATH and symlink

To quickly move around, I added a path to CDPATH that contains symlinks to different locations. I did this by adding the following line to .bashrc: export CDPATH=~/symlinks When working with ...
3
votes
3answers
209 views

Absolute link pointers, able to work in another system

I have a folder and within it there are many links. I make those links absolute, so that I can move them about within the folder and they still point to the same data. Relative links would break if I ...
3
votes
4answers
2k 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 ...
3
votes
1answer
47 views

Read target of symlink and increment target by one

I have a folder structure that looks like this /some/folder/1 /some/folder/2 ... and a symlink current that links to one of the folders. Is it possible and when how to read the target of the link, ...
3
votes
2answers
451 views

Make firefox command run downloaded firefox instead of iceweasel

I have downloaded Firefox, but when I run firefox in Alt+F2 (Gnome 3.4.2), Iceweasel runs instead. I used the type command to find the file apparently responsible for this: #!/bin/sh ...
3
votes
1answer
37 views

How to create a relative symlink which works across PC

I have the following directory structure to start with ~/a/bin ~/a/src -> /home/user/b/sync/src I created a symlink cd ~/a/src ln -s ../bin bin-xyz now bin-xyz is a broken link, and there is ...
3
votes
1answer
111 views

Test for link with trailing slash?

I created in /tmp/test/ mkdir somedir ln -s somedir/ somelink I want to loop through only directories: for file in */ ; do if [[ -d "$file" && ! -L "$file" ]]; then echo "$file is a ...
3
votes
2answers
160 views

Is there way to replace value of symbolic link? [duplicate]

Is there way to replace value of symbolic link? For example I want to replace symbolic link like this: first -> /home/username/foo/very/long/directories/that/I/do/not/want/to/type/again to ...
3
votes
1answer
102 views

Symbolic link starting with .#

I have a symlink in one of my directories that has the following name: lrwxrwxrwx 1 XXXX ZZZ 37 Jan 15 18:18 .#perl.org -> XXX@YYY.com.2980:1344441539 I am wondering what this symlink ...
3
votes
3answers
381 views

How to diff two folders by inodes

I'm currently using a script to backup files on my computer. In a nutshell, it works like this: rsync --link-dest=$FOLDER/current $SOURCE $DESTINATION However, I think that my script may be ...
3
votes
1answer
654 views

How do you increase MAXSYMLINKS

In a python script, I am creating a bunch of symbolic links chained together. example: link1->link2->link3->.......->somefile.txt I was wondering how you can change the max number of symlinks to be ...
3
votes
2answers
3k views

Create symbolic links with wildcards

I have multiple hard drives with the same directory hierarchy, for example: /media/sda/dir1 /media/sda/dir2 ... /media/sdb/dir1 /media/sdb/dir2 Two hard drives with similar names and similar ...
3
votes
2answers
45 views

Script to replace all symbolic links to a target to point to another target (in the same directory)

Given the following contrived example: $ mkdir -p a/b && touch a/b/original-target && touch a/b/new-target $ mkdir -p c1/c2 && cd c1/c2 && ln -s ...
3
votes
1answer
412 views

ls -l --group-directories-first (act on symlinks as well)

ls option --group-directories-first causes directories to be listed on the top, which makes the output of ls nice and clean: ls -l --group-directories-first However, it does not act on symlinks, ...
3
votes
1answer
68 views

Where are information stored information about hard/soft links

Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced ...
3
votes
1answer
1k views

Why is permission denied for npm start using node-dev?

I am trying to start a node.js application with on a low permissions user. All the files I know of are owned by the correct user and have permissions set reasonably well. I'm trying to use a script ...
3
votes
1answer
548 views

How can I efficiently dereference all symlinks in `find` *output* filenames?

I need paths to be both fully resolved and relative to a given directory. This must be done efficiently, since the number of paths is often greater than 100,000. Situation: I have directories which ...
3
votes
1answer
907 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: ...
3
votes
2answers
3k 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 ...
3
votes
1answer
69 views

Does the Linux loader (ld.so) follow symlinks?

I have stumbled upon a problem by trying to move the ld.so.cache file to another location. I have tried to create a symlink for it in its previous location -- /etc/ -- but it seems that the loader ...
3
votes
2answers
393 views

Gzip large amount of symlinked files

I have a folder containing a large amount of symlinked files. These files are each on the order of 10-11GB (fastq files to be specific). They come from a variety of source folders, but I made sure ...
3
votes
1answer
359 views

rsync: how to relocate absolute symlinks?

I've pored over the rsync manpage as well as on several related questions here on serverfault. I've played with -R and -L and -l options, but no luck. Here is the question: when sending a dir from ...
3
votes
1answer
482 views

FreeBSD: Remove symlinks in devfs

Background I have been rebuilding a small home NAS. This server represents my first 'real' foray into the world of server administration and it has taught me quite a bit already. Originally, the ...
3
votes
2answers
2k views

Use `ln` to create a missing directory

So I'm writing a small package manager, and a problem I've run into is making the symbolic links to files. It installs the package to /usr/pkg/name-version, and then reads a file to determine what ...
3
votes
1answer
878 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 ...
3
votes
3answers
182 views

Creating a local workspace for development/testing

I want to be able to mount, say /home/$USER/workspace to /usr/local/workspace. Right now I'm using the python package pyfilesystem which uses fuse to do that. My problem is, that inside that mount I ...