Questions tagged [symlink]

A special type of file that references an inexistent or existing file or directory. The contents of a symbolic link consist of an arbitrary string that is the path to the file that the symbolic link points to. When the symlink is encountered during pathname resolution, the string stored by the file is used to modify the pathname resolution.

Filter by
Sorted by
Tagged with
1
vote
1answer
12 views

Symlink to directory for easy access: .bashrc, usr/local/bin, something else?

(Mint 19.1, based on Ubuntu 18.04) I have a directory I frequently access but which has a long path. I am tired of typing it out, so I want to be able to easily jump to this directory. The simplest ...
-1
votes
0answers
20 views

Create an updatable directory of symlinks

Let me take a directory called DIR/ with the structure DIR/ |----> file1.txt |----> file2.txt |----> file3.txt |----> SUB_DIR/ |-----> file4.txt What I want to do is create ...
3
votes
3answers
106 views

Recursively “find” file names containing string and symlink files in another directory

I am trying to symlink a set of specific files from a project I'm working on. There is a known string in each of the filenames I wish to symlink. Here is what I have so far: ln -s find ~/path/to/...
1
vote
1answer
40 views

How to check the timestamp of a symbolic link?

Is there a way to use traditional commands to update a symlink when it's older than the original file? I use a Seafile server (similar to Dropbox) to make certain files available to my students. So I ...
-2
votes
0answers
35 views

Is it safe to symlink files to ~/.bashrc ~/.bash_profile etc

I was thinking of creating a git tracked project something like so: /bash-stuff .git bashrc bash_profile profile install.sh and in install.sh it would just run: ln -s "$HOME/proj/bash-...
1
vote
1answer
43 views

How to remove soft link to directory?

[murphy@eva02 playg]$ ls -l total 12 drwxrwxr-x. 2 murphy murphy 4096 Jul 22 14:02 dir1 lrwxrwxrwx. 1 murphy murphy 4 Jul 22 14:03 dir1-sym -> dir1 drwxrwxr-x. 2 murphy murphy 4096 Jul 22 14:02 ...
0
votes
1answer
18 views

How to create a symlink the desktop way in debian Xfce?

The method of using ctrl + shift and clicking on the item in the file manager does not work. Is there another method to achieve the creation of a symlink from the desktop? thanks for any hint
0
votes
1answer
17 views

Symlink on remote file server to refer to file on local machine over sshfs

I have an sshfs mount to my file server. In the mounted directory there is a symlink that points to /tmp/localfile. /tmp/localfile does not exist on the remote server, but does exist on the local ...
0
votes
1answer
28 views

Recursive Symbolic links

I want to drop through my mp3 folders and create a sym link to each mp3 in a folder called links. I would like for my links to be relative to the directory structure rather than absolute. I tried this ...
1
vote
1answer
20 views

Linux: synchronize directories via symlinks

I have two directories, say A/ and B/, each with their own subtree. I'd need to synchronize the content of A/ with the content of B/. The result I need is similar to recursively copying the subtree ...
1
vote
2answers
45 views

What sort of file thing do 'namespace files' point to?

I was poking around /proc/*/ns, and noticed that namespace files look unfamiliar: # example from `man namespaces` $ ls -l /proc/$$/ns total 0 lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 cgroup -> cgroup:[...
0
votes
1answer
31 views

run a software with input file as symbolic link

I have a directory with thousands of files, and I want to run a software multiple times in different directories with the same input files without copy the input in each directory, I have created a ...
0
votes
1answer
25 views

Link files and directories, in target directory, with cross-device links

I have a user account at my local library (they use openslx), in which I can store files. My actual home folder is "mounted" (I'm not sure how) in /home/[my_userID]/PERSISTENT instead of /home/[...
0
votes
2answers
32 views

Convenient way to cd into a frequently-used dir? [duplicate]

A dir I cd into a lot has a really long path. I'd like to reduce keystrokes. I have tried this... sudo ln -s /mnt/c/Users/me/ho/hum/bin /mybin It works, but something about it seems wrong. Is ...
0
votes
1answer
51 views

How can a single file system object be both a symlink and a directory?

When I ls it, it's a directory with a bunch of files in it. But when I ls -l it, it's a symlink to something that's NOT a directory. What's going on — how is it possible? $ ls /sys/class/net/...
1
vote
1answer
29 views

mariadb.service - linking unit aliases mysql.service & mysqld.service - (why) is it necessary

I cannot find the originally site I found how to set up MariaDB on linux. Dependend on that tutorial I wrote an ansible playbook. While refactoring my playbooks I found those two tasks. - name: ...
0
votes
3answers
36 views

How to completely uninstall java from RHEL?

When I do which java I get the following output: which java /dir/java/bin/java I have already uninstalled java rpm using the following `rpm -qa | grep -i java` rpm -e rpm-name Still java is not ...
1
vote
1answer
36 views

Safely remove a symlink or hardlink

Does using rm on a symlink or a hard-link remove the source in addition to the link? Is there a good way to delete a hard-link or a symlink without deleting the source? And if there is a good way ...
0
votes
1answer
29 views

Symlinks with grub2 like pxelinux

I do want to do symlinks like pxelinux can, just with grub2. But I cant figure out how. The goal is to have different config-files which I can dynamicly pass to an IP. Grub2 does work so far but I ...
0
votes
1answer
61 views

Difference between file descriptor and soft/hard link

If soft link and hard link are pointer to a file. And file descriptor is a file handle pointing to an open file. Then what exact difference is between the two if both of them are a kind of pointer ...
0
votes
1answer
30 views

Rsync keep full symlink directory structure

So, I am trying to keep the synlink structure when transfering files, so my folder structure: $HOME/backup/backup/symlinks - $HOME/Documents/hello.txt $HOME/backup/backup/data Now, when I sync I ...
1
vote
1answer
40 views

Is there a way to create a symlink to a non-existent target?

Is there a way to create a symlink whose target does not exist using shell scripts? From reading man 1 ln, I do not see an option to do so; and even -f checks if the target exists. Is there a way to ...
2
votes
1answer
67 views

Why can't I access a symlinked directory

I want to (soft)link my .thunderbird dir onto the actual directory which is on a SD card. Thus, (xenial)florian@localhost:~$ ls -la /var/host/media/removable/SD\ Card/.thunderbird/ total 24 drwx-----...
1
vote
1answer
39 views

Create a directory if it doesn't exist when symlinking a file into that directory

Assume I want to symlink like in the following command: ln -s /home/user/dots/cmus/cmus.theme /home/user/cmus/cmus.theme But for the above command to work, I need to make sure that the directory /...
2
votes
0answers
44 views

Automatic symlink to latest folder

Is there a way in Linux to automatically maintain a symlink to the latest version of a file/folder in a certain location? My use case: I generate datasets with unique job names, then write them to a ...
-1
votes
1answer
22 views

access soft symlink directory's contents in bash [duplicate]

I have a bunch of symlinks pointing to various directories. Each of the target directories happen to have a space in them, I have not created them like that, but they are being received as such via ...
0
votes
0answers
57 views

weird symbolic link

I found a weird symbolic link shown below. 1st line looks fine, but 2nd line(starting with ->) is weird. Is this normal? If not, how can I fix it? lrwxrwxrwx 1 kcc-2 asp2 37 05 May 23:53 ...
0
votes
1answer
55 views

Make a `ln -s` that checks for broken symbolic links

I am trying to write a function ln() (if it is not a good idea to call it ln, it may just be as well called myln() or whatever, but that is not important) in bash, such that, If the short option -s ...
0
votes
1answer
44 views

A command to know if some file are “only” an hard link and “not” a symlink [duplicate]

I need a command for an if condition to know if 'file_name' is an hard link (not symlink). Thanks
2
votes
1answer
49 views

I need a command to know if a file is linking to another file

How I can know if file1 is a symbolic link to a file2? I need an if condition.
0
votes
1answer
57 views

Why are Linux namespace links in /proc red in color?

I inspected the symlinks in an Ubuntu VM for the namespace related directories under /proc/PID/ns. I see all the links are in red color. I even tried to test using unshare to see if I can create a ...
1
vote
1answer
55 views

unlink/rm target of an open symlink

I've come across an issue where processes that load symlinked .so files crash if I update the .so while the processes are still running. I have long-running processes that load shared libraries (.so)...
0
votes
1answer
42 views

Debian - Restore a Timezone File [duplicate]

So, I just screwed up a timezone file on my Debian system because I pointed it as a link to /etc/localtime vs. pointing /etc/localtime to it. Specifically, /usr/share/zoneinfo/America/Puerto_Rico. I'...
0
votes
1answer
15 views

Symbolic Link Restores Original File

On Linux, I created a file (file1): echo Hello file1 > file1 Then, I created a symbolic link (file2), to file1: ln -s file1 file2 After that, I removed file1: rm file1 Lastly, I edited file2 ...
3
votes
3answers
9k views

How to create a folder symlink that has a different name?

I want to create a symlink ~/.pm2/logs -> /opt/myapp/log When I run ln -sFf /opt/myapp/log ~/.pm2/logs I get a symlink ~/.pm2/logs/log -> /opt/myapp/log which is not what I want. I'd ...
0
votes
2answers
65 views

Is it possible to “add” a second folder to the current folder file contents? symlink?

question: Is it possible to "add" the contents of a 2nd folder to the current folder file contents? (In essence I was asking from a full Unix is perspective but may be nginx would work too as the goal ...
1
vote
1answer
265 views

Python symbolic links mixed up

Using Ubuntu 16.04 Tried to set python 3.6 as default for the python3 command. I found what seemed to be the answer and quickly copy-pasted the following lines without carefully reading: $ sudo ...
1
vote
1answer
68 views

Create symlink to a directory I don't have permissions over

Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company. IP still remains theirs alone, individually, as well as the ...
0
votes
1answer
33 views

I want to make symlinks of all files in a directory EXCEPT the existing symlinks in the directory

I have a bash script that creates symlinks from the directories in one users directory to another users directory. I want the script to exclude existing symlinks in the source directory when creating ...
0
votes
2answers
72 views

rm -rf ~/Desktop - how to fix it and/or change the location

I was trying to symlink Windows desktop with Lubuntu desktop folder, but have in the process removed the Lubuntu folder completely. I know I can't recover the lost files, but how do I fix this now, ...
0
votes
0answers
58 views

Find file and directory size while ignoring symlink in sub-directories

I have a directory structure where there are multiple symlinks at random depths. For illustration purpose: /fs /fs/afile /fs/blink -> /usr/local/lib /fs/cdir/cfile /fs/cdir/cdir/cdir/clink -> ...
3
votes
1answer
260 views

Permission denied when cd to symlink'd dir in /tmp that is 700 and owned by regular user

Question: Why am I not able to cd into a symlinked directory with 700 permissions, owned by a regular user, as root, when I am able to change into the directory itself? Example: ttucker@plato:/tmp# ...
0
votes
3answers
150 views

Error to Create symbolic binary link

I want to create a symbolic link for vi to see this program when calling from console run vim: ln -s /usr/bin/vi /usr/bin/vim` ln: failure to create symbolic link «/ usr / bin / vim»: The file ...
1
vote
1answer
58 views

Rsync not correctly copying Symlinks

I have an rsync to copy over some rpms from one server to another but the issue is that the symlinks are not being created properly on the receiving server. My rsync options are -avz --force --delete ...
0
votes
1answer
666 views

zip command show warnings “name not matched” about symlinks, outside of my working directory, pointing to non-existing target

I have some weird warnings when zipping a directory's content. I use a command line I use for a ton of websites backup since years and never had such issue, and I try to figure out why I have the ...
3
votes
1answer
145 views

Some special files in Unix

Background There are lots types of special files in Unix, for example symlinks, device files and proc files (under /proc). /proc files are just normal files or even text files. But for the rest, I ...
1
vote
3answers
194 views

Protecting Linux systems from symlink attacks

Linux-based systems are vulnerable to symlink race attacks from unprivileged UID processes. For example, a PHP process on a shared hosting can create a symlink to /etc/passwd in a directory where ...
1
vote
1answer
69 views

/bin/sh symbolic link not working properly

I am using i3, and by default, it uses sh when starting process with the i3 config exec command. This is fine and dandy, but that means the environmental variables created in my .zshrc do not get ...
0
votes
0answers
10 views

How to install Linuxbrew into a user defined folder

Llinuxbrew installation install the package on the home folder. For some reason I need to install Linuxbrew into a different folder. At the moment, I installed it and moved the whole folder into a ...
2
votes
0answers
74 views

AIX : NOFOLLOW_LINKS is not supported on this platform

I have an AIX 7.2 machine. I am trying to run a Java program on it. It gives me this error: NOFOLLOW_LINKS is not supported on this platform. It is because I am using this call in the program: Files....