Questions tagged [ln]
ln is the Unix utility for creating filesystem links.
34
questions
0
votes
0
answers
41
views
Make symlink to file/folder using Automator workflow service
I've created a service that runs the following shell script:
for f in "$@"
do ln -s "$f" "${f}.deleteThisExtensionAfterMoving"
echo "${f}....
0
votes
1
answer
32
views
Copy relative links to absolute links
Given a directory /path/to/files that contains many relative links along the lines of foo -> ../other/data/foo, how do I copy the links in files/ to be absolute path links on /mydata/path/
I ...
0
votes
0
answers
121
views
How do I install Wine on a seperate drive?
I have very limited space on my laptop, and Wine once fully installed, is almost 1GB in size, and I simply don't have space, and cant free up space.
Is there anyway that I could make use of symbolic ...
0
votes
2
answers
1k
views
Creating a symlink or alias that point to current user´s home sub-folder
Is it possible to create, using terminal on a mac, for a mac, a symlink or an alias to ANY currently logged in user of a mac?
This symlink/alias is to be included as a "drop destination" for a ...
2
votes
2
answers
6k
views
Unlink (remove) directory symlink
I did:
ln -s /DATA/ ./base_DATA/
and I'd like to unlink. Simply:
unlink ./base_DATA
but... unlink: cannot unlink './base_DATA': Is a directory
According to this answer (and many other online) the ...
1
vote
1
answer
186
views
Remove hard link when target is locked by system process
I've created a hard link (not symbolic link) Arial.ttf in my user directory using the Git for Windows GNU tool ln.exe and Bash. The link points to the system font C:\Windows\Fonts\arial.ttf.
ln /c/...
16
votes
1
answer
24k
views
How to create symbolic links in /usr/bin on a Mac?
Environment: OSX Sierra, Darwin Kernel Version 16.3.0
Root Problem: I want to use a bunch of shell scripts in a central repository, which have a #!/usr/bin/zsh. On my Mac, the zsh is in /bin/zsh.
...
0
votes
1
answer
619
views
Symbolic linking in Terminal (What am I doing wrong?)
I want to create symbolic links for all files in a folder parent/target/. I want the links to be in the folder parent/destination/. My working directory is parent/ for the following terminal output ...
1
vote
1
answer
375
views
OS X - ln -s on a directory in ~ shows strange behaviour
I'm currently setting up my new system (OS X) and trying to link ~/Git/ to /Library/WebServer/Documents/, so that I can access all my git repositories via 127.0.0.1. However, that doesn't work as ...
2
votes
1
answer
1k
views
Find all files matching desription and create hard link in directory
I would like to find all .mkv files in my download directory and create a hard link to them in my /movies/ directory.
Here’s what I have so far:
for i in `find /download/ -name *.mkv`; do ln "$i" /...
2
votes
1
answer
2k
views
Ignoring 'ln' errors in Vagrant provisioning
I'm using a shell script in my Vagrantfile to create a symlink for Node.js (in a Ubuntu VM):
ln -s /usr/bin/nodejs /usr/bin/node
That works fine when I call vagrant up for the first time, but when I ...
1
vote
2
answers
111
views
Can I Soft-Link files from my desktop to a server in Linux
I am looking for creative ways to sync my vim files (~/.vimrc, ~/.vim/) on the server I am running.
Can I soft-link files from my desktop machine (Fedora) to any of the nix servers I am on?
1
vote
0
answers
553
views
Add external volume app folder to Launchpad
I have a primary volume and secondary volume which I store apps on in a folder called HDD Applications. Launchpad only looks at the /Applications folder on the primary drive for apps.
How can I get ...
3
votes
2
answers
3k
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 ...
20
votes
1
answer
14k
views
How to overwrite a symbolic link of a 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
2
answers
3k
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
1
answer
604
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
1
answer
2k
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 or,...
1
vote
1
answer
224
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 ...
5
votes
1
answer
13k
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 ...
11
votes
2
answers
13k
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 ...
4
votes
2
answers
1k
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 (...
3
votes
1
answer
3k
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 do: ...
1
vote
1
answer
8k
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 ...
3
votes
5
answers
6k
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 I'...
0
votes
1
answer
1k
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 ...
1
vote
2
answers
4k
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
2
answers
4k
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 still ...
2
votes
2
answers
116
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
1
answer
692
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 /bar/a,b,...
1
vote
1
answer
973
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
1
answer
78
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
1
answer
458
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 ...
10
votes
2
answers
34k
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 ...