A special type of file that references a file or directory.

learn more… | top users | synonyms (1)

1
vote
1answer
9 views

Map Home to External Drive

Whereas I have my OS (in this case, Elementary OS Freya) installed on my non-partitioned internal hard drive, I have an external hard drive with /Documents, /Downloads, /Movies etc. where I store all ...
3
votes
2answers
60 views

List direct symbolic links (links that don't point to another symlink)

I need to make a list of all direct symbolic links in a directory, i.e. symbolic links that point to another file which is not a symbolic link. I tried to do it this way: for i in $(ls -1A); do ...
6
votes
3answers
955 views

How to ls using the long format (-l) while still following directory symlinks?

I've noticed that ls -l doesn't only change the formatting of the output, but also how directory symlinks are handled: > ls /rmn biweekly.sh daily.sh logs ... > ls -l /rmn lrwxrwxrwx 1 root ...
7
votes
2answers
51 views

How does the /proc/<pid>/exe symlink differ from ordinary symlinks?

If I start a process and then delete the binary of it, I can still recover it from /proc/<pid>/exe: $ cp `which sleep` . $ ./sleep 10m & [1] 13728 $ rm sleep $ readlink /proc/13728/exe ...
0
votes
1answer
17 views

Getting “Protocol Error” when trying to create a symlink in Docker

I'm trying to setup a symlink, using the command ln -s /var/www/data/cache/widget/overlay/ /var/www/public_html/images/overlay but it outputs ln: failed to create symbolic link ...
79
votes
7answers
33k views

How can I find broken symlinks

Is there a way to find all symbolic links that don't point anywere? find ./ -type l will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. ...
16
votes
3answers
564 views

When I cd through a symlink, why does pwd show the symlink instead of the real path?

I created a soft link (ln -s 1 2) to a directory which is inside the test directory and opened the soft link (cd 2) and displayed the current path using pwd. The displayed path was ~/test/2 and not ...
3
votes
6answers
41 views

How to copy a folder structure and make symbolic links to files?

I have a folder SOURCE that contains several sub-level folders, each with its own files.. I want to copy this folder in a new folder COPY where I need to copy the directory structure but keep the ...
13
votes
2answers
317 views

Is there anyway to automatically mount a filesystem when I open a symbolic link to a directory on that filesystem?

I am using Arch with Xfce. Recently, I have created a symbolic link to a directory on a filesystem. But I don't want to mount the filesystem during boot or manually mount it before I open the ...
3
votes
1answer
45 views

automate the process of fixing all broken links

There are lots of broken links in my system. I wrote a script to relink all broken links. But, after the scripts runs, find would again show me that the links still exists. This is my code: find ...
1
vote
2answers
58 views

What file mode is a symlink?

What file mode indicates that a file is a symbolic link (symlink)? My use case is to detect symbolic links inside a git repository (and its history). I was under the impression that a symlink is a ...
0
votes
2answers
28 views

Can Symbolic Links span different file systems in Unix or Linux

Can Symbolic Links span different file systems in Unix or Linux ??? I.e consider different file systems like ext2 and ext3 can symbolic link span them?
5
votes
2answers
157 views

How can I list files of which no symlinks exist?

I have a large "myfiles"directory full of miscellanous documents and do not want to modify its structure. I therefore created (several) other directories for each class of documents. For example I ...
0
votes
1answer
20 views

How I can change all symlink to the new path [duplicate]

Please, I want to change the symlink to the new path My symlink's in this form lrwxrwxrwx. 1 s01 s01 56 Mar 22 13:17 zmjppcxlpq2m.png -> /home/s01/public_html/cgi-bin/uploads/00029/zmjppcxlpq2m ...
2
votes
1answer
39 views

How to avoid sed -i to destroy symlink?

Why does sed -i executed on symlink destroys that link and replaces it with destination file? How to avoid this? eg. $ ls -l pet* -rw-rw-r-- 1 madneon madneon 4 mar 23 16:46 pet lrwxrwxrwx 1 madneon ...
0
votes
1answer
32 views

Is it possible to link file to an output of command line? [duplicate]

I want to create symlink, or a pipe, or something else that could be used in lieu of a file. I want that pseudo-file to execute a command and output of that command should become the contents of that ...
2
votes
1answer
45 views

How to verify the target of a symbolic link points toward a particular path

Within a bash script, I know I can check if a file is a symbolic link with the following syntax if [ -L $path ] Does any one know how I would test if that path was linked to a particular path? E.g. ...
0
votes
1answer
42 views

Links in /usr/bin or /usr/local/bin: hard or symbolic?

For the links located in /usr/bin and in /usr/local/bin, are they better to be hard or symbolic? They seem to be all symbolic? Why?
2
votes
3answers
21 views

list all symbolic links to valid directories only with find

I can use find /search/location -type l to list all symbolic links inside /search/location. How do I limit the output of find to symbolic links that refer to a valid directory, and exclude both, ...
1
vote
3answers
55 views

How can I create a relative symlink given a relative path?

I would like to programmatically find the directory depth of a relative path. So for example the depth of test/dir/hello is 3 More specifically I would like the directory depth so that I can create a ...
2
votes
2answers
47 views

copy files from the parent location when I am inside a symbolically linked folder

Suppose I have created two folders in /tmp called parent and child. child contains a file called test-child.txt and parent contains a file called test-parent.txt. Now lets go inside the parent and ...
0
votes
1answer
32 views

Overhead when relocating a directory to a different file system using a symbolic link

I need to relocate some frequently accessed files to a different file system. The simplest way of doing this is to move the directory containing the files to the new file system and creating a ...
1
vote
2answers
135 views

Is it safe to symlink to /usr/include/x86_64-linux-gnu/sys from /usr/include/sys?

I'm missing the /usr/include/sys dir and all of its headers. I have build-essentials and supposedly every other -dev package I require for this make. From reading around I understand that it's safe ...
0
votes
2answers
20 views

Create a symbolic copy of another directory that has it's own local data

I have a directory foo that contains files and directories. I want to create a new directory foo_0311 that contains the same files as foo (and sees updates when the files change), but that allows by ...
0
votes
1answer
20 views

How would I find any symlinks on my system that reference “/tmp”?

I need to create a list of all symlinks that reference the /tmp directory. How many are there in total?
1
vote
2answers
75 views

Why does httpd give an error following a symlink into my home directory on Fedora?

I've just re-enabled an app after OS change. Symbolic link to it is located of course in /var/www/myapp . After changing permissions to 0775 (even 0777 temporary), changing owner to apache:myuser, ...
7
votes
3answers
10k views

Why change the owner of a symbolic link in linux?

In linux it's possible to change the owner or the group owner of a symbolic link (symlink). I was wondering why someone would want to do that, since permissions of a symlink are not used when ...
2
votes
1answer
50 views

cp -a fails to copy symlinks on virtfs

Problem: Trying to copy the entire content of one directory to another which includes hidden files/directories and symlinks. This is fairly straightforward cp -a ${src} ${dst} It works as expected ...
28
votes
3answers
11k views

How can I “relink” a lot of broken symlinks?

I have a directory tree which has a bunch of symbolic links to files under /home... however, I have moved /home to /mnt/home and need a way to "relink" all of the symlinks. Does such functionality ...
1
vote
1answer
39 views

Absolute path from user input without losing symlinks inside

Is it possible to convert in a shell script a user input path (absolute or relative) to the absolute path but without losing the symlinks inside, e.g. /a/b/c is the current user dir and c is a symlink ...
2
votes
1answer
35 views

Make links work in backup?

One file system of mine has many symlinks which link to directories in the file system. Is it possible to create a backup of the file system where the backups of the links work (i.e. still point to ...
0
votes
1answer
26 views

Update symlinks by scripting? [duplicate]

I have a directory which contains many symlinks which point to other directories. Now I would like to rename a common ancestral directory of the linked directories by the symlinks, and also have ...
0
votes
0answers
33 views

udev not running rule at boot?

I have a very simple udev rule at /etc/udev/rules.d/sdcard.rules: KERNEL=="mmcblk1", SUBSYSTEM=="block", SYMLINK+="sdCARD" Problem is the symlink is not created for me automatically at boot. I have ...
4
votes
2answers
410 views

Advantage of symlinks over Windows style shortcuts

When I mainly used Windows, to make a shortcut, I could use a regular file detailing where it linked to, with the extension .lnk or .url Now, on Linux, I mainly use symbolic links, which are a ...
1
vote
0answers
33 views

Create Symbolic Link for Windows Machines

I currently operate a SMB file server for my network and, like a lot of you guys, don't touch Windows myself. I need to create a symbolic link that will work on my user's Windows machine to ...
1
vote
2answers
1k views

Why absolute symlink on SAMBA share is followed directly by CIFS mount?

If an SMB share has a symlink with an absolute path /share/latest/dir -> /share/data/201407 then Windows clients can access files by link with no problem. dir \\smbserver\share\latest\dir\ ...
0
votes
0answers
36 views

Symbolic link path [duplicate]

Hi I want to find out the path of symbolic link. I want to make a script for that but I can not find a command that will print the path of symbolic link. I want to write a script with directory as a ...
2
votes
1answer
294 views

Why do I get 'error while loading shared libraries: libssl.so.6 cannot open shared object file' even after I run ldconfig?

The symlink libssl.so.6 shows up in /usr/lib/x86_64-linux-gnu, and I ran ldconfig but I still get this error: error while loading shared libraries: libssl.so.6: cannot open shared object file: No ...
2
votes
1answer
38 views

Creating symlinks in the etc directory without root access

What I would like to create if I had root access would be a symlink from some file or folder in the /etc to another file or folder in the /etc. However, I do not have root access. Is there any way to ...
1
vote
1answer
23 views

symlinking to `.rbenv/`: how much is too much?

I've been keeping most of my dotfiles in a git repo and symlinking to them, e.g. ln -s ~/Development/dotfiles/bash_profile ~/.bash_profile which has been great. I did something similar with .vim/ ...
11
votes
4answers
1k views

Should I include a trailing slash / in a symlink to a directory?

Symlinking to a directory gives to different results with ls -l depending on whether I ln -s dir or ln -s dir/. But what's the actual difference, and which one should I prefer why?
5
votes
7answers
2k views

ls content of a directory ignoring symlinks

I have a directory in which I would like to list all the content (files and sub directories) without showing the symbolic links. I am using GNU utilities on Linux. The ls version is 8.13. Example: ...
3
votes
0answers
63 views

How is This Symbolic Link Not Being Followed?

I have LibreOffice Writer and OpenOffice Calc installed on my OpenSuSE system. This is arguably not ideal, but before I fully switch to one or the other, I noticed some strange behaviour when calling ...
78
votes
6answers
22k views

Why hard links not allowed to directories in UNIX/Linux

I read in text books that UNIX/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the ...
0
votes
3answers
3k views

Replace symbolic link which linked to directory target

I want to upgrade tomcat server from 7.0.19 to 7.0.20. I've already ln -s apache-tomcat-7.0.19 tomcat7 before, so now I need to link tomcat7 to new target using the following command ln -s --force ...
1
vote
2answers
123 views

readlink -f not working on multiple files

I tried to run readlink -f on multiple files by using wildcard "*", but it evaluates other files as operand Command readlink -f *log Output (desired) /home/trail_1.log /home/trail_2.log Am I ...
1
vote
2answers
67 views

ls .. doesn't work properly with symlinks

I have directories set up a bit like this ~/code ~/code/src ~/code/build -> /path/to/somewhere/else That last one's a symlink. If I do this cd ~/code/build ls .. then I get the listing for ...
1
vote
1answer
34 views

Understanding directory symlinks traversals and the parent directory

Let's say you have directories /dir1 and /dir2/linked, where the later is a symlink to the former. When you cd to linked and pwd, you get the output /dir2/linked. If you then cd .., you'll be put on ...
2
votes
3answers
54 views

How to determine if a soft link's target is a directory or a file?

Given the ll command outputs as follows #> ll lrwxrwxrwx ... How to determine if a soft link's target is a directory or a file from "lrwxrwxrwx"?
0
votes
1answer
36 views

In Mint 17, how do I copy/paste symlinked files?

In Mint 17 (Cinnamon), I'm using the file manager (I guess it's called Nemo?) to view some header files after building OpenSSL in the 'include' directory. Each of the header files in this directory ...