Questions tagged [ln]
ln - Command line tool to create hard links to existing files and soft links to existing and non-existent files.
149 questions
-1 votes
1 answer
41 views
ln fails to create link
I am running Raspberry Pi OS 64 bit (Debian GNU/Linux 13 (trixie)) I am attempting to create a hardlink to a python executable (which works). When I run ln ~/bin/gpioreadall.py ~/bin/gpioreadall I ...
11 votes
6 answers
3k views
Why are symbolic links more common than hard links in Unix/Linux? [closed]
I frequently find myself googling the difference between symbolic links and hard links. Each time, I conclude that hard links seem superior in most use cases, especially when Linux is my daily driver. ...
1 vote
2 answers
102 views
rm on symlinks works different on Mac
The following commands behaves different between Linux and Mac: mkdir tmp ln -s tmp symlink rm -rf symlink/ On Linux, the content of tmp folder is deleted but the folder itself remains, while on Mac ...
1 vote
1 answer
370 views
A command in $PATH but can't run and "ln" link not work on Debian 12
The computer system is Debian 12. As needed to update my LaTeX, I tried the command sudo tlmgr update --all, which returned sudo: tlmgr: command not found. But which tlmgr returned /usr/local/texlive/...
0 votes
3 answers
152 views
Is there a shortcut to denote the absolute full directory of current path? [duplicate]
Let's say that I am currently in /a/b/c/d/e/, and I want to make symbolic link with a file f.txt in that directory. If I do ln -s f.txt /etc/, the file /etc/f.txt will not point to the file, because ...
3 votes
2 answers
213 views
How can I copy directories recursively with hardlinks with variables in bash?
The operation I'm trying to do is take directory 1: Dir1 Dir A File A Dir B File B Then use the find command to check every file in Dir 1 for whether or not they have an ...
0 votes
1 answer
42 views
Why when i copy file from a symlink directory one level up copy is created one level up from original directory?
user@DESKTOP-KK4CCE2:~$ mkdir -p ~/foo/bar/ user@DESKTOP-KK4CCE2:~$ touch ~/foo/bar/test.txt user@DESKTOP-KK4CCE2:~$ mkdir ~/baz/ user@DESKTOP-KK4CCE2:~$ ln -s ~/foo/bar/ ~/baz/bar user@DESKTOP-...
0 votes
1 answer
656 views
Command substitution with xargs inputs [duplicate]
I'm trying to write a simple command that will create symlinks for all files in a specific directory (Yes, exactly like lndir but I cannot use it so I try to mimic it). I tried the following using ...