ln is the Unix utility for creating filesystem links.

learn more… | top users | synonyms

1
vote
2answers
52 views

Make a symlink in bash with two relative paths

I have two directories in my home: ~/dir1 and ~/dir2 with a file in the first: ~/dir1/file.txt Is there any way that I can make a symlink to it from ~/dir2 without moving to ~/ and if not why is that ...
0
votes
0answers
66 views

How can I create hardlinks to an OSX bundle? Or the symlinks inside the bundle?

I have a hierarchy of files that I need to hardlink to a temporary install location. Some of those files are frameworks. Frameworks are bundles but essentially just folders, which aren't supported by ...
2
votes
1answer
595 views

how to overwrite symblic link of directory?

There are two directories foo1 and foo2. At first I make a directory symlink by ln -s foo1 bar. After that I want to change the symlink, so I typed ln -sf foo2 bar But bar is still linked with foo1. ...
1
vote
2answers
193 views

Easiest way to restore symbolic links turned into text files?

I had folders with many symbolic links in them. Unfortunately after copying that around different filesystems, they've turned into plain text files with the link target as the contents. That is: ...
0
votes
1answer
63 views

ln -s -T :: what does the “-T” switch do exactly?

I've seen the -T switch being used, e.g. here. Looking at the man page it simply reads: "treat LINK_NAME as a normal file". Can somebody shed some light showing the difference between using and not ...
2
votes
1answer
630 views

Why doesn't ln -s prompt that it fails when creating a symlink to an existing symlinked directory? [closed]

When running (on linux different ubuntu variations): >ln -s dir_1 symlink_dir >ln -s dir_2 symlink_dir It fails without telling that it fails. But if you do the same thing on a file instead ...
1
vote
1answer
103 views

Using the link command to keep backups on another drive

I have a folder that contains a not so large amount of space called /data/backup. I have been told that if I link that folder (/data/backup) to an even bigger folder area like /bigdata/backup for ...
1
vote
1answer
2k views

Symlink all files in a Folder to a new Folder

Ideally what I am seeking is a way to rename all my anime keeping original files intact without using extra data space The solution I can think of is creating a duplicate folder path to another ...
5
votes
2answers
2k 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 ...
2
votes
2answers
611 views

Does the target in ln -s have to be a full path?

I've tried to invoke ln in directory ~/download as this: ln -s ./abc ~/abc [EDITED] but it does't work. I do ls -al in my home and get wrong link of abc. ln [OPTION]... [-T] TARGET LINK_NAME ...
2
votes
1answer
779 views

How can I get Total Commander to recognize Cygwin symlinks?

I love Total Commander. I love Cygwin. But they are not always friends. One thing that bugs me, is the way symlinks work in Cygwin. Suppose I do this: $ ln -s my/path/to/nirvana budhism And then ...
1
vote
1answer
5k views

Creating a symbolic link to a folder with ln command

I'm setting up the document root of my web server to point to a folder elsewhere on the disk. Should I be using a hard link, or a soft link, with the ln command? Also, I'm having trouble getting the ...
2
votes
5answers
905 views

Does ln -s require you to be in a certain directory?

I want to create a simple symlink to a file. It works perfectly if I run the command from inside the directory where I want the symlink to be created: /path/to/link $ ln -s /path/to/file . But if ...
0
votes
1answer
217 views

Auto rename symbolic link

I have a folder which contains many sub-folders which contains many images. I find it tedious to go into each folder to browse the images so I decided to create an empty folder and create symbolic ...
0
votes
1answer
981 views

Unix pipe: find | ln -s

I'm trying to symlink some php files using the following command: find `pwd` -name "*.php" | ln -s * /home/frankv/www/bietroboter.de/symlinks However, all the symlinks are broken because the little ...
4
votes
2answers
757 views

What is “ln -L” (--logical) for?

I can read in the ln man page: -L, --logical make hard links to symbolic link references I read somewhere that ln -L could be used to re-link files that were deleted but which are ...
2
votes
2answers
103 views

Problem with permissions when syncing to sites directory

Is there a way to symbolically link a directory using ln to my ~/Sites/ directory on OS X so that the permissions are correct so it may be viewed in a web browser when I'm doing web development on a ...
2
votes
1answer
275 views

Symlink all files but copy certain extensions

I'm wondering how I'd be able to symlink all the files in a dir structure and then also copy files of a certain extension in that dir. I'm basically symlinking all files within /foo/a,b,c to ...
1
vote
1answer
309 views

Linker (ln) error: can't find certain files

I'm building something from source and I get the following output while running make: ... CC libpromises_la-mod_outputs.lo CC libpromises_la-unix.lo CCLD libpromises.la CC ...
2
votes
1answer
65 views

How would you link a number of files (e.g. *.so) by one-liner in Linux?

I need something like ln -s /from/*.so But ln doesn't allow such. So how would you do then?
0
votes
1answer
260 views

Listing All Linked Files

I can't seem to find a way to do this, so maybe it's not actually possible, but I was wondering if there was a way to list all files that link to a file. For example. touch a ln a b ln a c I want ...
6
votes
2answers
23k 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 ...