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
1
vote
1 answer

How to create symlink to another symlink without following symlink while keeping relative path?

How to create a symlink to another symlink without following target symlink but keeping relative path between the target symlink and created symlink ? Using the following structure for test ├── dst │   └── src ├── file.txt -> folder/file.txt …
moocan
  • 111
  • 2
  • 11
1
vote
1 answer

Symlink existing directory

I have an app in /usr/abc and I want to link the abc app to /dump/abc (this is an existing directory). When I run ln -s /usr/abc /dump/abc the link is created inside /dump/abc/abc directory. But I need the content of /usr/abc to be in /dump/abc and…
Shree
  • 111
  • 1
  • 2
  • 8
1
vote
1 answer

How to apply a rolling window with linear regression and multiple variables in R( or python)?

I have date over 708 days. There are 6 products columns with sell numbers in the row. There are also 13 variables. Most of them are weather date like sun hours or temperature, others are binary (no event=0, event=1). The goal is to predict the sell…
1
vote
2 answers

How to make rm not delete symbolic links?

So, I was getting rid of the unwanted files and I deleted some folder. After some time I saw another folder which appears red in ls -la. I knew I deleted the actual folder and thus I was very sad and tried to run foremost to recover but bad luck.…
Machine Yadav
  • 196
  • 3
  • 13
1
vote
2 answers

Change folder structure and make files available by using links

(Please see also the minimal example at bottom) I have the following folder structure: https://drive.google.com/open?id=1an6x1IRtNjOG6d9D5FlYwsUxmgaEegUY Each folder shows at the end: the date, month and day: e.g. /HRIT/EPI/2004/01/14 Inside for…
lio
  • 145
  • 1
  • 6
1
vote
3 answers

Divide value in each cell by the geometric mean of a specific row across columns and log-transform it

I would like to devide value in each cell by the geometric mean of a specific row across columns and log-transforme it (natural logarithm). df1 col1 col2 col3 row1 1 777 6 row2 136 1 665 row3 0 100 97 result df_new …
giegie
  • 463
  • 4
  • 11
1
vote
2 answers

How do I fix ln -s not working in Docker?

Step 3/10 : RUN mkdir -p /etc/nginx/{sites-available,sites-enabled} Step 4/10 : COPY nginx.conf /etc/nginx/ Step 5/10 : COPY sites-available/*.conf /etc/nginx/sites-available/ Step 6/10 : RUN ln -s /etc/nginx/sites-available/*…
JordanPlayz158
  • 81
  • 1
  • 11
1
vote
0 answers

How to tell quickly if a file is in a directory that is linked?

When I am working inside an IPython notebook, I sometimes do !pwd and of course it will show the directory that I am working in. But sometimes these files are inside a directory that is linked. e.g., when I do !pwd I'll see /a/b/c/, and when use…
makansij
  • 9,303
  • 37
  • 105
  • 183
1
vote
1 answer

Linux Hard Link (ln) and GIT

I have a linux hard link (ln) pointing to a file in git. Anyone does know what happens if I update the file in git? Do I have to make to hard link again?
nacho
  • 5,280
  • 2
  • 25
  • 34
1
vote
1 answer

ln -s create needed dir

echo "super-super.show.s01.e01" | grep -oPi '(?<=-)[\w\W]+(?=\.s\d\d)|s\d\d|e\d\d' | parallel -N3 ln -sf ~/super-super.show.s01.e01 ~/TV/{1}/{2}/{3} # tries to make ~/TV/super.show/s01/e01 failes due to no such file or directory How can i write my…
angelsen
  • 35
  • 5
1
vote
2 answers

Create symlinks while preserving subfolders tree

Let's say I have the following directory hierarchy |/home | |/john | | |/app | | | |/folder1 | | | | |/data1.dat | | | | |/... | | | |/folder2 | | | | |/... | …
Robotex
  • 105
  • 1
  • 2
  • 10
1
vote
1 answer

Move files in bulk and create links in their place in the directory in linux

I am trying to move hundreds of files from one directory to another but create a softlink in the old directory while doing that. Is there a single line command that can do that? /dir1 file1.txt file2.txt . . . file100.txt move to dir2 and create…
user3164754
  • 205
  • 2
  • 9
1
vote
1 answer

Why does ln from Python subprocess fail while it succeeds from normal command line?

As the title says: >>> from subprocess import check_output >>> check_output(['ln', '~/other_folder/src/models/sc_models.py', './src/models/sc_models.py']) Traceback (most recent call last): File "", line 1, in File…
kramer65
  • 50,427
  • 120
  • 308
  • 488
1
vote
0 answers

Two sets of libstd++.so and libc.so on the same system

I have an ARM device with an non-upgradable linux kernel running on it. I want to run some C++11 programs on it, however, the system libstdc++.so.6 and libc.so.6 are too old to support C++11 at runtime. I have copies of the newer libraries, but I'm…
Gillespie
  • 5,780
  • 3
  • 32
  • 54
1
vote
1 answer

What is the equivalent option in Ubuntu for OS X ln -h?

The osx command: ln -sfh /a/b /c/d Fails in ubuntu since h is not a valid option What's the equivalent command options?
user433342
  • 859
  • 1
  • 7
  • 26