Questions tagged [ln]

ln - Command line tool to create hard links to existing files and soft links to existing and non-existent files.

144 questions
8
votes
1 answer

What is `ln --no-dereference` supposed to do?

I'm refreshing my understanding of a few basic GNU/Linux commands that I admit that I never really understood fully for the last 20+ years. $ man ln in part says: -n, --no-dereference treat LINK_NAME as a normal file if it is a symbolic…
Elliptical view
  • 3,921
  • 4
  • 27
  • 46
5
votes
2 answers

ln: create symlink using another symlink

Let's suppose I have one file and one directory: $ ls -l total 4 drwxrwxr-x. 2 user user 4096 Oct 8 09:53 dir -rw-rw-r--. 1 user user 0 Oct 8 09:53 file I created a symlink to file called symlink1, and a symlink to dir called dirslink1: $ ls…
mrc02_kr
  • 2,003
5
votes
2 answers

Understanding the usage of ln

From coreutils' manual, for ln ln makes links between files. By default, it makes hard links; with the -s option, it makes symbolic (or soft) links. Synopses: ln [option]... [-T] target linkname ln [option]... target ln [option]... target...…
Tim
  • 101,790
2
votes
0 answers

Maintain Ownership While Updating Symbolic Links

I'm migrating a file system and I need to update a few thousand symbolic links that'll break as a result of the migration. My plan was to find all the affected links and build a script that'd process each link. For example: ln -nsf "$(readlink…
user
  • 83
2
votes
1 answer

Inconsistent behaviour creating symbolic links with relative and force flag

I have an issue with creating symbolic links with ln, with the relative and the force flag set. The scenario is as follows: $ tree . ├── folder1 │   └── file └── folder2 I create the link: $ ln -sfr folder1/file folder2 $ tree . ├── folder1 │   └──…
Oliver
  • 131
0
votes
2 answers

Making a link using ln -s

I'm trying to make a link using: ln -s /Backup files/ /link 1 Instead of making the link, I'm get the following output: ln: target '/link' is not a directory What am I doing wrong?
0
votes
1 answer

'ln' doesn't behave the same when executed in a script

I'm trying to install Guacamole through a script. When it comes to link the files stored in /etc/guacamole to tomcat8 directory, the following line works well when executed in the shell : ln -s /etc/guacamole/ /usr/share/tomcat8/.guacamole The…
JeanneD4RK
  • 151
  • 4
-1
votes
2 answers

How can i move from one directory to another using the command ln and a relativ path in linux

My problem is that I need to move from a directory to another one by only using the ln command So here I have this relative path: ../../10/wsl and I know I have to create a symlink with ln to be able to create a tunnel to the other directory. Then…
-2
votes
1 answer

Does this example implement the same as `ln -sr`?

From coreutils' manual about ln -r --relative Make symbolic links relative to the link location. Example: ln -srv /a/file /tmp ’/tmp/file’ -> ’../a/file’ Relative symbolic links are generated based on their canonicalized containing directory,…
Tim
  • 101,790