Questions tagged [symlink]

Symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.

symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution

2458 questions
143
votes
4 answers

How do I symlink all files from one directory to another in bash?

I want to link ( ln -s ) all files that are in /mnt/usr/lib/ into /usr/lib/ There are lots of files, how can it be done quickly? :)
KooT
140
votes
8 answers

Can you change what a symlink points to after it is created?

Does any operating system provide a mechanism (system call — not command line program) to change the pathname referenced by a symbolic link (symlink) — other than by unlinking the old one and creating a new one? The POSIX standard does not. Solaris…
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
139
votes
3 answers

symbolic link: find all files that link to this file

Hallo all, I need to do this in linux: Given: file name 'foo.txt' Find: all files that are symbolic links to 'foo.txt' How to do it? Thanks!
lukmac
  • 4,617
  • 8
  • 33
  • 34
126
votes
8 answers

Can sphinx link to documents that are not located in directories below the root document?

I am using Sphinx to document a non-Python project. I want to distribute ./doc folders in each submodule, containing submodule_name.rst files to document that module. I then want to suck those files into the master hierarchy to create a spec for…
mc_electron
  • 1,503
  • 3
  • 11
  • 13
113
votes
7 answers

How do I remove a symlink?

i just created the symlink sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib and am wondering how i get rid of it if I wanted to. How would i do this?
locoboy
  • 38,002
  • 70
  • 184
  • 260
105
votes
14 answers

Apache won't follow symlinks (403 Forbidden)

I'm having some trouble setting up Apache on Ubuntu. I've been following this guide. # /usr/sbin/apache2 -v Server version: Apache/2.2.17 (Ubuntu) Server built: Feb 22 2011 18:33:02 My public directory, /var/www, can successfully serve up and…
Tim
  • 6,079
  • 8
  • 35
  • 41
101
votes
4 answers

Nginx sites-enabled, sites-available: Cannot create soft-link between config files in Ubuntu 12.04

I am trying to create soft links between config files containing server blocks in the sites-enabled and sites-available directories in /etc/nginx/. The command I am using is: sudo ln -s sites-available/foo.conf sites-enabled/ When I then…
iamyojimbo
  • 4,233
  • 6
  • 32
  • 39
99
votes
3 answers

Does Amazon S3 support symlinks?

I have an object which I would like to address using different keys without actually copying the object itself, like a symlink in Linux. Does Amazon S3 provide such a thing?
The user with no hat
  • 10,166
  • 20
  • 57
  • 80
95
votes
3 answers

How do I change my pwd to the real path of a symlinked directory?

Here's a rather elementary *nix question: Given the following symlink creation: ln -s /usr/local/projects/myproject/ myproject ... from my home directory /home/jvf/, entering the myproject symlink gives me a pwd /home/jfv/myproject/. Now, I would…
Johan Fredrik Varen
  • 3,796
  • 7
  • 32
  • 42
95
votes
6 answers

How to find files excluding symbolic links?

I want to find files in Linux that follow a certain pattern but I am not interested in symbolic links. There doesn't seem to be an option to the find command for that. How shall I do ?
Barth
  • 15,135
  • 20
  • 70
  • 105
88
votes
3 answers

How to check if a directory/file/symlink exists with one command in Ruby

Is there a single way of detecting if a directory/file/symlink/etc. entity (more generalized) exists? I need a single function because I need to check an array of paths that could be directories, files or symlinks. I know File.exists?"file_path"…
claudiut
  • 1,643
  • 4
  • 15
  • 20
83
votes
6 answers

how to find the target file's full(absolute path) of the symbolic link or soft link in python

when i give ls -l /etc/fonts/conf.d/70-yes-bitmaps.conf lrwxrwxrwx /etc/fonts/conf.d/70-yes-bitmaps.conf -> ../conf.avail/70-yes-bitmaps.conf so for a symbolic link or soft link, how to find the target file's full(absolute path) in…
duhhunjonn
  • 44,855
  • 11
  • 28
  • 15
83
votes
10 answers

Is there a way to edit a symlink without deleting it first?

So I created a symlink: ln -s /location/to/link linkname Now I want to change the location that the symlink links to. How do I do that? is there a way to do it without deleting it first?
Andrew
  • 227,796
  • 193
  • 515
  • 708
80
votes
9 answers

Delete all broken symbolic links with a line?

For a given folder, how can I delete all broken links within it? I found this answer that shows how to delete one broken link, but I can't put that together in only one line. Is there a one-liner for this? A broken symbolic is a link that points to …
fotanus
  • 19,618
  • 13
  • 77
  • 111
79
votes
8 answers

Telling git to ignore symlinks

This question has appeared in similar forms here and here, but they don't seem to match up with what I'm looking for. I'm making a project in StaticMatic, a Ruby static site generator. Basically, it's just a src/ directory with Haml templates,…
user225643
  • 3,601
  • 5
  • 27
  • 22