Questions tagged [ln]

Use this tag for questions related to the `ln` (link) command. The `ln` command is available in *nix OS to create links, allowing more than one filename to refer to the same file. Two types of links can be created using `ln`: symbolic links and hard links. Do not use this tag to refer to the natural base-e logarithm (furthermore base-e log is written "log" in most programming languages): use the [natural-logarithm] for that.

The ln (link) command is used in *nix OS to create links, allowing more than one filename to refer to the same file. Two types of links can be created using ln:

  1. Symbolic links: refer to a symbolic path indicating the abstract location of another file. The two file names need not be on the same file system. System call: symlink().
  2. Hard links: refer to the specific location of a physical file. The two file names must both be on the same file system. System call: link().

Note: For questions related to ln function which is used to calculate logarithms, please use the tag.

162 questions
2
votes
1 answer

Create symbolic links for multiple books collected from command `find`

I'd like to create links of books. Firstly, I collect all the JS books find ~ -type f -iregex -Eo '.*javascript.*\.pdf' > js_books.md 2>/dev/null It returns 35 books ../Coding/Books/HTML_Collections/Freeman E.T., Robson E. - Head First…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
2
votes
0 answers

Cannot run symlink command - operation not permitted

I have this command: $ sudo ln -s "$(which chromedriver)" /usr/bin/google-chrome and I get this error ln: /usr/bin/google-chrome: Operation not permitted I tried with/without sudo, same thing. Anyone know what's up?
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
2
votes
1 answer

Undo sudo ln -sf

I was having an issue pushing a git commit, so I ran sudo ln -sf /usr/bin/nodejs /usr/local/bin/node now when running node -v or nodejs -v terminal tells me -bash: node: command not found. How can I 'undo' the sudo ln -sf
Simon Cooper
  • 1,574
  • 4
  • 24
  • 53
2
votes
0 answers

symbolic link binary with targeted directory

I have a binary which loads assets with relatives paths, and I would like to put a link in /usr/bin. I have tried ln -s ~/game_directory/game /usr/bin/game. It launches my binary but can't load my assets because it doesn't find the folder ./assets…
2
votes
2 answers

using system() to call ln from a cpp program

I am trying to call system from a cpp program with the following command system("ln -s -t \"targetDir[0]\" \"baseDir[0]\""); Both targetDir and baseDir are QStringList. The program compiles and runs but when I execute the command i get the error ln…
Chronigan
  • 83
  • 5
2
votes
0 answers

failed to create symbolic/hard link in volume in docker on windows 7

I am trying to execute shell script in volume inside docker container on windows 7 but seeing following errors: ln: failed to create symbolic link '/lib/tcl8.5': Protocol error ln: failed to create hard link 'libpython2.7.so' =>…
user5154816
2
votes
3 answers

"ln -sf" does not overwrite a symlink to a directory

ln -sf does not overwrite a given symlink to a directory. See e.g. % ls -ld program* drwxr-xr-x 22 b users 4096 Nov 25 14:33 program drwxr-xr-x 22 b users 4096 Nov 25 14:29 program-201611181546 -rw-r--r-- 1 b users 0 Nov 25 14:34…
Marco Wahl
  • 694
  • 7
  • 14
2
votes
4 answers

Using Bash, how do I feed a file list into a 'ln -s' without using 'find'?

I want to create symlinks to all files in 'myfiles' which are not already linked to and specify the destination folder for the just-created symlinks. I am using the following cmd, successfully, to generate the list of existing links, which point to…
Jim
  • 201
  • 3
  • 10
2
votes
1 answer

What is the proper way to make symbolic links with regard to file paths being full or shortened and relying on "token" expansion

Symbolic Links I am having a hard time understanding symbolic links. I believe I understand the basic premise, it is an alias essentially. However, does it depend on what working directory you are in when you make it on how it works, assuming you…
Scott
  • 571
  • 1
  • 4
  • 12
2
votes
2 answers

Symbolic link to database not working in /var/www

I am working on a leaflet map site with access to real time weather data. To avoid having to use SUID, because of it's security problems, I am using symbolic links from /var/www to my imagery data. These are simple png files, and this is working. I…
jhc
  • 1,739
  • 3
  • 21
  • 46
2
votes
0 answers

Error: Function not implemented when using FileUtils.ln_s

The following code causes me trouble: symlink_path = "symlink/to/mnt/xyz/file" remote_path ="/mnt/xyz/data/folderx" FileUtils.mkdir(remote_path) FileUtils.symlink(symlink_path, "#{remote_path}/#{db_table_name}") FileUtils.cp on the other hand does…
David Schumann
  • 13,380
  • 9
  • 75
  • 96
2
votes
1 answer

Is the character '-' invalid to start a symbolic link on Linux?

I have to rename some folders. They have all this structure local-XXXX local--pdf-preisliste- local--pdf-kundendienst local-navi_flash_home and I have to drop the local- prefix. In order to maintain the current folders, I wanna create symbolic link…
jomaora
  • 1,656
  • 3
  • 17
  • 26
1
vote
1 answer

Npm link and scoped packages

When running npm link (as per the multiple vague blog posts on the subject) on a private scoped packed, I am getting an E404 error. This seems particularly odd considering the entire point of npm link is to sym-link local files. I do not understand…
myol
  • 8,857
  • 19
  • 82
  • 143
1
vote
1 answer

Prevent curve_fit from trying certain values

I'm trying to use Python's curve_fit to fit a function to some data. I have a function y = aln(bx + 1) where a and b are constants to be found, y is the dependant variable and x is the dependant variable. The data for x and y are given by xdata and…
1
vote
3 answers

Symbolic links to symbolic links... partial canonicalization

Suppose I create a symbolic link "file2" to a file "file1" two directories above the current location (e.g., "ln -s ../../file1 file2". But now suppose that "file1" is also a symbolic link to a file "file0" two directories down from its location…
SO Stinks
  • 3,258
  • 4
  • 32
  • 37