We changed our privacy policy. Read more.

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
5
votes
3answers
1k views

Create old style 'slow' symbolic links

ln -s creates 'fast' symbolic links. These break if you copy them (and their targets) to e.g. optical media. I believe old style 'slow' symbolic links would work, but how can I create them? There's no ...
0
votes
1answer
44 views

/etc/mtab as a symlink on Centos6

On a Centos6 system, can I delete /etc/mtab (the file) and create it as a symlink to /proc/self/mounts? As I understand it, starting from Centos7 (and other newer distros), the file /etc/mtab no ...
0
votes
1answer
36 views

Unable to create symbolic link of compiled executable to my PATH directory

I've compiled this build of the SameBoy Game Boy emulator with success. However I'm unable to ln -s the resulting executable to my PATH directory in ~/.bin/, as it returns too many levels of symbolic ...
70
votes
4answers
46k views

Get path of current script when executed through a symlink

I have a utility consisting of a couple of directories with some bash scripts and supporting files that will be deployed to several machines, possibly in a different directory on each machine. The ...
65
votes
2answers
9k views

Symbolic link recursion - what makes it "reset"?

I wrote a little bash script to see what happens when I keep following a symbolic link that points to the same directory. I was expecting it to either make a very long working directory, or to crash. ...
0
votes
1answer
30 views

Do programs themselves use symbolic links, or are they just for users?

For example, when I type python it runs python2 because for me, /usr/bin/python is linked to /usr/bin/python2.7 But does this affect programs? If there are programs on my system that need python 2, ...
13
votes
3answers
16k views

How to make a symbolic link to /usr/bin/vim but with start-up parameters?

After I make&make install vim from source, I found many symbolic links of vim in /usr/local/bin, such as evim, rvim, view... The vim(1) man page said that "rvim" is equivalent to "vim -Z" and so ...
1
vote
2answers
2k views

Puppy Linux Live CD: "Symbolic Link to Unsupported Reparse Point"

Here are a few specs: Windows 10 Pro Slacko Puppy 6.3 700 MB CD 16 GB RAM 2 TB HDD Currently, to do some testing, I am running Puppy Linux from a live CD and attempting to access the files on my ...
1
vote
1answer
2k views

Apache 2.4 does not follow symlink and gives 403 Forbidden?

I have been trying to setup my project on localhost as symlink into /var/www/html, I can access normal files or directories placed inside html but when I create a symlink to some/other/path, it gives ...
19
votes
4answers
14k views

Is a symbolic/soft link similar to a shortcut/alias on a PC?

It sounds to me like the basic idea of soft/symbolic links compared to shortcuts (on a PC) or aliases (on a Mac) are the same thing. Am I way off? Are they similar?
4
votes
3answers
2k views

How to make a symlink read only (`chattr +i /location/symlink`)?

How can we lock a symlink so it cannot be deleted? With a normal file/directory chattr +i /file/location can achieve this but doing so with a symlink we get chattr: Operation not supported while ...
0
votes
1answer
111 views

Trying to find examples of --strip-trailing-slashes

I find the --strip-trailing-slashes option of the mv command confusing. According to the official GNU manual, this option is "useful when a source argument may have a trailing slash and specify a ...
19
votes
5answers
9k views

Finding duplicate files and replace them with symlinks

I'm trying to find a way to check inside a given directory for duplicate files (even with different names) and replace them with symlinks pointing to the first occurrence. I've tried with fdupes but ...
0
votes
2answers
37 views

Linking and Copying

I have a few questions regarding links in UNIX Can I say Soft links in UNIX are analogous to shortcuts in windows? Difference between copying and hard-linking? Can anyone give me a use-case where I ...
2
votes
1answer
94 views

Prevent mv from moving target folder

If symbolic link bar points to folder foo, then the two following commands have very different behaviors: mv bar baz # rename link 'bar' to 'baz' mv bar/ baz # rename folder 'foo' to 'baz' (...
1
vote
1answer
40 views

rsync update symlinks pointing to same directory

I want to use rsync to make a copy of a folder that contains symlinks to other files in the same folder. Is it possible to get updated symlinks -pointing to absolute paths- in the destination? I mean, ...
1
vote
1answer
8k views

How to resolve "Too many levels of symbolic links" on my Documents folder?

I am using the latest Deepin 15.11 and have just discovered that I cannot access my Documents folder (/home/username/Documents). In my file manager (Deepin File Manager) it simply says "You do not ...
2
votes
2answers
2k views

Cannot start Springboot as init.d service on port 80

I've been following the official guide to setting up Springboot as an init.d service on an Amazon Linux ec2 instance. Before I got to this setup, I was running into the problem where I could not start ...
233
votes
1answer
358k views

How to change where a symlink points [duplicate]

Can you tell me what this is in the area marked red? If I want to change /media/files/tb-prod/files to some other path, how would I do that?
4
votes
3answers
5k views

`ls` Attemptes to list nonexisting symbolic links on WSL

I have clean installed windows 10 (build 1803). I have installed Ubuntu from the Microsoft Store and enabled Linux subsystem. I have done this several times in the past, and never have I had the ...
-1
votes
3answers
2k views

Copy folder with symlinks

How can I copy a folder that contains symlinks and retain the symlinks in the destination folder? I'm doing something like this with PHP/Bash: system("cp -r production-clone-target production-sites/{...
0
votes
1answer
255 views

Reconfigure dangling symlink libc.so.6

I didn't do the cleverest thing and changed the /lib64/libc.so.6 symlink - better still it points to something that doesn't exist - and best of all, the path it points to is within /lib/, a folder ...
8
votes
4answers
17k views

Symlink all subdirectories in a directory to another directory

I'm trying to symlink every directory in a folder to another folder. For example, in the structure below, I need the subfolders symlinked to folder2. - /home/chris/folder1 -- subfolder1 -- subfolder2 ...
3
votes
1answer
930 views

Symbolic links do not allow SELinux type_transition

Trying to access symbolic link does not allow to use SELinux type_transition. I mean that I tried to implement scheme in which user has access to a symbolic link located in /usr/bin/ and which leads ...
8
votes
2answers
20k views

Create symbolic links with wildcards

I have multiple hard drives with the same directory hierarchy, for example: /media/sda/dir1 /media/sda/dir2 ... /media/sdb/dir1 /media/sdb/dir2 Two hard drives with similar names and similar ...
0
votes
1answer
198 views

what is difference between symbolic link file and executable file?

I was exploring the /bin directory. The /bin contains file of two different colours, which according to this answer correspond to: Green indicates executable file Sky blue indicates system link In ...
0
votes
1answer
38 views

Create a symbolic link containing certain subdirectories

Assuming I have the following directories: /source/dir1/sub1 /source/dir1/sub2 /source/dir1/sub3 /source/dir1/sub4 /source/dir2/sub1 /source/dir2/sub2 /source/dir2/sub3 /source/dir2/sub4 ... (...
80
votes
5answers
136k views

How do you make samba follow symlink outside the shared path

This is Ubuntu server 10.04 64 and samba 3.4.7. I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one: ln -s /home/temp /home/mit/share/temp But on ...
3
votes
1answer
934 views

Check if symlink is broken or doesn't exist

Trying to make an if statement that checks if a file is a valid symlink (meaning it also exists). I tried: [ -h "$1" -a ! -e "$1" ] ... buut it doesn't work. I want to execute code if the file isn'...
59
votes
6answers
71k views

How can I remove all symbolic links with a special target?

With the command: ls -la * I can list all my symbolic links. How can I remove all symbolic links which are linked to a special folder? For example: In my directory usr/local/bin I have the ...
82
votes
7answers
105k views

Make a symbolic link to a relative pathname

I can do this: $ pwd /home/beau $ ln -s /home/beau/foo/bar.txt /home/beau/bar.txt $ readlink -f bar.txt /home/beau/foo/bar.txt But I'd like to be able to do this: $ pwd /home/beau $ cd foo $ ln -s ...
0
votes
1answer
42 views

Executing a symbolic link yields different results than executing the file to which it points

The context I've downloaded scilab-6.1.0.bin.linux-x86_64.tar.gz from the official website of "Scilab" because I want to be able to use the provided tools. Within the bin directory of the downloaded ...
0
votes
1answer
96 views

How to symbolic link the files to new directory based on names in text file?

I have a directory named STRBAM. In that, I have following .bam files that are symbolic linked from another directory. Sample-CK-4952-01A-01D-1719-10.bam Sample-A6-5656-01A-21D-A270-10.bam Sample-AZ-...
0
votes
1answer
33 views

How to remove a directory symlink without breaking files that depend on it?

For the sake of simplicity, suppose the following situation, where folder is a symlink to new_folder: . ├── folder -> new_folder/ ├── new_folder │   └── test.sh └── exectest.sh The contents of ...
57
votes
8answers
45k views

Find only destination of symlink

For use in a shell-script, I'm looking for a commandline-way to get the destination of a symbolic link. The closest I've come so far is stat -N src, which outputs src -> dst. Of course I could ...
0
votes
1answer
61 views

How preserve just read permission from an original file to a symlink?

I make a copy file, from directory A, as a symlink in directory B and I need to preserve just the read permission from original file to symlink. like this example: original file have –rwx-wxr-x, link ...
0
votes
1answer
60 views

Can you use symbolic links to always remove one layer of a directory tree?

Is it possible to use symbolic links or some other method, i.e. a 'virtual directory' or mount, by which the following is achieved, and persistent? Directory tree A, original root dir | +-- dir 1 ...
2
votes
4answers
399 views

Switch symlink and directory

I have a directory and a symlink to it: mkdir dir ln -s dir dir_symlink I want to replace the symlink with the directory and the directory with the symlink. Is there a way to do that atomically (or ...
0
votes
2answers
54 views

Create Symbolic Link for Directory

I create a symbolic link for a directory, What links are the files in the directory and subdirectories? hard link or symbolic link?
0
votes
1answer
16 views

How to have symlink to content of source up to date?

So, by doing ln -s /my/source/* ./ I created a link to content of source but changes in source aren't reflected in the target. For example, when I create new folder in source it's not being shown in ...
3
votes
2answers
90 views

How do I copy files across/outside symbolic links? (dest) [duplicate]

Suppose I have a file system like this: /home/me/dir1/dir2/dir3/dir4/dir5/dir6/file1 Then in /home/me/dir1, I create a symbolic link: $ cd /home/me/dir1 $ ln -s /home/me/dir1/dir2/dir3/dir4/dir5/...
1
vote
3answers
2k views

How do I copy directories and symlink files?

I have got a directory of huge files (total ~ 1TB) and I don't want copy them around. However, I'd like to work around them, so it would be convenient to have them linked in a directory hierarchy I ...
0
votes
1answer
86 views

Repair broken symlinks to new location

I moved from an old webserver to a new one. Now some symlinks not working, because we changed the folder structur. I want to know if there is a easy way to repair these links? I found the links with ...
0
votes
0answers
22 views

Remove file when rm its symlink

I have storage folder which contains 2 folders - files and tags. files folder structure: 0 1 2 3 etc. Folders 0, 1, 2, 3 contains hashed named files. tags folder structure: private public admin ...
3
votes
1answer
799 views

How can I make realpath never resolve symlinks?

I'm looking for a command to return the absolute path of a file, without resolving symlinks. In general, realpath does this well. $ mkdir /tmp/test; cd /tmp/test $ mkdir foo $ ln -s foo bar $ ...
1
vote
0answers
75 views

rsync does not follow symlink

I want to copy one file from one Linux server to another one: Firstly, I've checked the following: ls -l /etc/letsencrypt/live/example.com/fullchain.pem lrwxrwxrwx 1 root root 46 mar 28 19:50 /etc/...
0
votes
1answer
360 views

Problem with initializing user while installing MySQL Server

I'm trying to install my first community MySQL server instance and seems to be stuck on symlink not working. I'm following the procedure for installing MySQLfrom Installing MySQL on Unix/Linux Using ...
0
votes
1answer
96 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 ...
14
votes
2answers
675 views

Can I setup a symlink to the most recent folder?

I have some directories: drwxr-xr-x 10 shamoon staff 320B Mar 20 10:05 dryrun-20200320_140542-1vbczul4 drwxr-xr-x 10 shamoon staff 320B Mar 20 10:06 dryrun-20200320_140605-uze15jta drwxr-xr-x ...
4
votes
1answer
529 views

find and symbolic link

I was skimming over the documentation of find to better utilize the command usage. I was reading the part that says GNU find will handle symbolic links in one of two ways; firstly, it can ...

1 2 3
4
5
21