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
0
votes
1answer
36 views

Read content of MS Windows shortcut from within VirtualBox

I have setup (using vagrant) a VirtualBox machine with a shared directory. I can read text files from the /media/sf_vagrant just fine. However I cannot cat the content of a file that I can only ...
0
votes
2answers
24 views

Are new output files created in symlinked directory or also in original directory?

I created a symlink to a directory but it seems that new output files from executing some analyses are also stored in the original directory - is this to be expected? From my understanding, the new ...
-1
votes
2answers
43 views

Interpreting this command

A few days ago I found the following command: for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done As far as understand this command is going to create a symbolic link between ...
4
votes
2answers
6k views

Using ls command with symbolic links

I currently do not understand what is going on when I try to find the contents of or information for a symbolic link to a directory when using the ls command. I understand there is an option -H for ...
0
votes
2answers
485 views

Rsync for perfect copy: softlinks become..dir

I do a "clone" from one mounted disk to other disk mounted remotely. I will cal them local and remote. Local is slackware,and remote ubuntu On local df -h /mnt/ Filesystem Size Used ...
0
votes
1answer
524 views

When downloading (using scp?) a file via symbolic link is it possible to save it under the original filename?

On a server, the directory structure is already organized like this. (For sake of argument, I can't change it. I can only figure out a way to make it more useful to me.) /work/product/versions/app-...
1
vote
1answer
119 views

Ls is showing some bash script for the dead symlink instead of a filename

This is a Symfony PHP Framework's bin/ directory, output for ls -la For some reason it is showing a bash script instead of a filename. The Linux version is Debian Stretch. This is the result of the ...
8
votes
1answer
4k views

Bash: redirect to file, always create new

In bash, a command link echo test > actual.txt will replace the contents of the file called actual.txt with "test", and create the file if it doesn't exist. However, if the file does exist, bash ...
1
vote
1answer
300 views

symlinked udev rule not working upon OS boot

I have a udev rule that mounts a certain USB device to a custom mount point under /media I confirm working, and it sits on my user's space (say /home/myuser/a.rules). And I created a symbolic link ...
0
votes
1answer
21 views

Aliasing path expansion

I've recently switched from my personal Dropbox to a company one. This means that my Dropbox folder is now named "Dropbox (Company)" from "Dropbox". Now I had all my work under my personal DB folder,...
0
votes
1answer
37 views

What could have caused a symbolic link to be deleted?

About a week ago I changed the timezone on my VPS using the following command: sudo ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime A couple of days later I get up in the morning and find the ...
0
votes
1answer
2k views

How to have tar follow all symlinks except one recursive symlink

Is there a way (in several commands if necessary) to make a tar archive that follows all the symlinks (like with tar -h) except for one recursive symlink, which should be preserved as it is? I have a ...
0
votes
1answer
574 views

Why permission denied from folder that is a symlink of a home's subfolder?

In my Fedora I have some additional HDD with partition mounted as /media/dilnix/data witch contains the most of my huge files sorted in folders like "Music", "Downloads", "Video" etc. Those folders ...
1
vote
1answer
73 views

Symbolic link does not appear to exist

MacOS here, although I'm 99% sure this is a Unix question. I'm trying to see exactly where MySQL is installed. In a terminal I enter: which mysql And I get: /usr/local/bin/mysql So I see what's ...
2
votes
2answers
253 views

Is there a simple way to recursively copy all symbolic links under a directory to another directory, preserving the structure?

I have a directory ~/tmp/foo/ that's populated with subdirectories, files, and symbolic links. $ tree ~/tmp/foo/ tmp/foo/ ├── eggs │ ├── baz │ │ └── link3.txt -> /home/me/file3.txt │ └── ...
1
vote
1answer
123 views

Paths in ln with hard links and soft links

How does the relative paths work in ln (-s or not)? For example if I type ln -s foo bar/banana.txt what does this mean? What is foo relative to? Because it doesn't seem to be relative to the current ...
3
votes
2answers
1k views

Accidentally created symbolic link to a folder in that folder

I was creating a symbolic link to folder1/folder2 in home-folder. But I accidentally did: ln -s folder1/folder2 while in folder2 instead of in home-folder. So I ended up accidentally creating a ...
0
votes
1answer
190 views

Is it possible to a shadow file in symlinked directory?

Say I've got the following directory structure: root |__A |__some_file.txt |__... |__B |__A -> root/A Where root/B contains a symlink to root/A. I want to keep everything about A the ...
1
vote
1answer
213 views

How to symlink files in folders

Iterate over files in folder and creating symlinks: I have the current script that is trying to iterate over files in a folder, and create symlinks into another folder: #!/bin/bash ##################...
1
vote
1answer
32 views

Using find to only step through symbolic links n times?

Is it possible to use find to recursively search a path but to only step through into a path which is symbolic link to a specified depth of n? There is -maxdepth but this includes regular directories ...
7
votes
2answers
495 views

How to use ls to group directory symlinks with other directories?

ls --group-directories-first displays all directories before files, but if there is a symlink to a directory, it is displayed among the files. Is there a way to group directory-symlinks with other ...
0
votes
0answers
155 views

Mount several directories in the same partition, AND hide base path

I have a computer with an SSD and an HDD. I want to put the directories that do not change often in the SSD and the ones that do in the HDD. This means keeping root / in the SSD, along with most paths ...
0
votes
1answer
65 views

How to resolve /dev/disk/by-* to device in a shell script?

In a (Bash) shell script I do wish to resolve a partition label — f.e. /dev/disk/by-label/X — to the corresponding device (partition)number: /dev/sdX1. How can I resolve a /dev/disk/by to ...
0
votes
2answers
458 views

Symlinking all dot-files and -directories

Say I have a folder ~/dot containing some files and directories, such as zshrc, Xresources, and emacs.d. How do I create symlinks to all of those in ~, but such that the symlinks begin with a dot (....
-1
votes
1answer
162 views

Broken symlink to Vim

I am trying to launch vim. I probably created a bad symlink to vim. I used which and alias commands to find out what is happening. Why doesn't it run vim properly? MacBook-Air:~ miszo97$ which vim /...
2
votes
1answer
4k views

How remove or fix broken symbolic link?

In my case this is the problem ~ $ find ./ -type l -exec file {} \; |grep broken ./.mozilla/firefox/mwad0hks.default/lock: broken symbolic link to 127.0.1.1:+3704
3
votes
2answers
1k views

Mount --bind in the same filesystem move files as in the same filesystem

If I mount --bind /a in /b and if I mv /a/bigfile /b/ it will take a lot of type (if the origin file is big). This will actually copy the file and then delete from the origin instead of simple update ...
2
votes
2answers
77 views

Faking a directory path without the full path existing

I'm working with a build system that relies on absolute paths to reference source files etc. When I want to test building with different toolchains, I mount the src directory in VMs or chroots. The ...
0
votes
0answers
132 views

Apache2 - link DocumentRoot to subfolder on external drive but alter permissions

I have an exfat formatted usb drive mounted at /media/usb/drive1/ with root user via /etc/fstab. Now I would like to link my apache2 DocumentRoot which is located under /var/www/websites/ to a ...
4
votes
1answer
912 views

How do I find symbolic links where target path matches a pattern?

I am trying to find all symlinks below current folder whose target contains 'Dropbox' My best guess was: find . -type l -iname '*Dropbox*' But this returns nothing. I want to find items such as: ...
0
votes
0answers
54 views

improve my bash script to find, remove and symlink directory tree

I have this script that I have been using for a while and it mostly works, but there are some problems I would appreciate assistance in rectifying. The goal is to look at an external mountpoint, ...
1
vote
0answers
503 views

Why doesn't Samba represent Linux symlinks as NTFS symlinks?

Samba is showing/representing symlinks as regular folders. NTFS has symlink reparse points, and these can be represented via UNC - I tried sharing the Users directory in Windows and it showed the ...
1
vote
1answer
46 views

Recursively replace all links with actual files (gnu)

In order to run Code dx on Linux files, I need to replace all links with the actual files. Haven't worked in Linux in years and am getting confused by terminology. Been searching for answers for two ...
3
votes
1answer
52 views

Get maximum level of symlinks

I would like to get the number of maximum possible symlink level in the system. I found that it is hardcoded in the kernel to be 40. But I would like to get this number dynamically, in case someone ...
2
votes
3answers
181 views

Remove symlinks originating from specific directory

I have an "install.sh" that installs my personal scripts: find /home/Steven -name '*.sh' -exec ln -s -t /usr/local/bin {} + I would like to make an "uninstall.sh" that removes the symbolic links ...
2
votes
1answer
40 views

Is there a way to get a list of symlinks pointing somewhere under a partition?

I have a mounted partition with a lot of data on it, much of it is useless, but I want to backup what is still used. I know that everything that is still in use has a symlink pointing to it, for ...
1
vote
1answer
30 views

Create soft links from multiple specific files in various subdirectories

I want to create soft links (ln -s) to folder2 of all the files that contain *foo* in its name, and can be found in some or all the subdirectories of folder1. I've tried it with for, find, and find -...
-1
votes
1answer
835 views

How to create softlink for a file /var/log/messages on /root/Desktop with same name using ln command

Which one should be the target and which one be the link name? Update 1: I am logged in as super user, and I also got to know to access root folder using GUI.
0
votes
1answer
323 views

How to chdir to symlink source and not target in .screenrc

Is there a way to tell screen not to dereference symlinks when one is passed to the chdir command? In my .screenrc I have commands like this: chdir /data/project1 screen -t "project1" chdir /data/...
1
vote
1answer
124 views

Symlink permission issue on Linux + ZFS

I have two symlinks pointing to the same target directory. ls shows one of them (the bad one) belonging to the 1001 user, the other to root. Any user other than 1001, even root, can list the directory ...
1
vote
0answers
187 views

How to view MATLAB livescripts?

When I try to open a matlab livescript inside the default DE, I get an error that says: Viewing MATLAB Live Script files is not currently supported by this operating system configuration. For more ...
0
votes
2answers
45 views

Obtain list of directories in hierarchy, which contain only symbolical links

I'm aware of various tools available to obtain a list of directories in hierarchy, which contain only symbolical links, but I am not proficient enough to invent a solution myself. Personally, I will ...
0
votes
2answers
158 views

Linux Symlink Traversal Issue

I am trying to use a USB PENDRIVE to increase my current path for building a large library. So, I have this idea of creating a symlink in my program to a folder in the Pendrive. So that it uses the ...
1
vote
1answer
109 views

Source control and symlink for .zhistory

I symlink dot files from my home directory to actual files in a separate folder that is under git source control. This works great, but for some reason I am having problems with .zhistory. $ echo $...
2
votes
1answer
2k views

Creating a copy of a file, that gets automatically updated

I'm using Fedora 26. I want a script to run at startup, but also have this script in my scripts folder. How can I make it so the /etc/init.d/foo gets updated when I edit ~/scripts/bar? I was thinking ...
2
votes
1answer
523 views

How to bind mount from a symlink

This is similar like How do I do a bind mount over a symlink? But here the question is how to do a mount --bind from a symlink? I have /linux-4.13.0 and a symlink linux pointing to that: /linux -> /...
1
vote
0answers
340 views

Symlinks not working on GlusterFS Fuse mount

I am running GlusterFS 3.11.3 on CentOS 7 64-bit in an OpenVZ environment. Since I am not the datacenter owner and the OpenVZ hosts don't allow sys_admin privileges to virtual machines, I have ...
5
votes
1answer
796 views

Apache can't open file that is a symlink

I have a file: js/jquery.terminal-src.js: symbolic link to ../../repo/js/jquery.terminal-src.js and when I try to open it with browser using: http://localhost/projects/jcubic/terminal/test/js/...
1
vote
2answers
7k views

ls shows a directory but it is inaccessible

I was trying to copy one folder from one location to another. The folder is about 6.4 Gb. So I did cp -r source_folder level1/val after that, I went into the level1 folder and checked: level1$ ...
6
votes
2answers
2k views

Info on cp --preserve=links

I'm trying to understand what cp --preserve=links does when used by itself, from my tests it seems that it copies a normal file normally and dereferences symlinks, but it seems like it just has the ...