1
vote
1answer
30 views

realpath (GNU coreutils 8.22) does resolve “.” symlink regardless of “-s”

I'm trying to use realpath in a script which has to ensure that it is located under a certain (possibly symlinked) path. Also the script has to be runnable from any location, so it cannot presume that ...
2
votes
1answer
30 views

Can I create a “symlink-esque” file to “merge” two files together?

I'm dealing with an application that reads a config file, config.yml, from the current directory. This config file contains both secret information (API keys) that shouldn't be checked in to source ...
0
votes
1answer
24 views

Not able to reference softlinks in a script

we have couple of softlinks to scripts a directory in our current directory. Let's take we have two softlinks , script1 and script2. We are referencing script2 from within a script1 like below. . ...
1
vote
1answer
35 views

Show one folder's content in other folder

My question is about Linux. I have 2 folders - /home/user/first and /home/user/second. In the /home/user/first there are some files. The second folder is empty. What I want to do is to have ...
0
votes
1answer
25 views

Using shortcuts to create identical file structure

I've got a Debian based OS with TV shows spread over multiple disks but the series are not all on the same disk. For example, Show1 has 10 Season, Season 1,2, 4 and 5 are on Disk1, 3, 6 and 8 on ...
1
vote
1answer
50 views

Symlink to a directory including the trailing slash and without

Is there any noticeable difference between symlinking to a directory including the trailing slash and doing it without, i.e. the difference in doing ln -s somedir/ dir vs. ln -s somedir dir whereby ...
0
votes
2answers
113 views

cd shortcuts: symbolic link to CDPATH dir

I found a solution to another question and posted here and wanted to implement it. On OSX, in order to create cd shortcuts, it advised creating a hidden folder with symbolic links, and then adding ...
0
votes
2answers
266 views

Hide files in unix without changing their name (adding the dot) so that scripts that use them still work [duplicate]

Short version: I want to be able to prevent certain files from appearing in the output of ls, without adding the dot, and thus changing their names. Long version: Recently, I moved a bunch of scripts ...
0
votes
1answer
74 views

Creating a file through a dangling symlink with vi

This is the content of my typescript file, /mac>ln -s non_exist ~/link /mac>vi ~/link Hi! I am a link. /mac>cat ~/link Hi! I am a link. /mac>cat non_exist cat: non_exist: No such file or ...
2
votes
1answer
57 views

Can I create a symlink or similar that returns a random file from a set every time?

Say I have files foo-a.wav, foo-b.wav and foo-c.wav on disk. I have a piece of software whose interface allows me to enter the name of a single sound file; every time a certain feature of that ...
0
votes
3answers
198 views

How to give access to user for specifig directory?

I made symlink when logged in as www (apache user): ln -s /home/anotheruser/test /var/www/test Now I go to my mydomain.com/test and I get a 403 error. /home/anotheruser/ has permissions 764 ...
3
votes
2answers
120 views

One line ls command to display symbolic links

How can I use just one single ls command to display all symbolic links in my /dev directory? I know ls -l and that's about it.
0
votes
1answer
527 views

Can't remove/delete symlink

I have tried to create a symlink and it threw this error: ln: accessing `.test': Permission denied Now I can't unlink or delete the symlink file. Tried Googling for help but could not find a ...
1
vote
1answer
2k views

Unix Copy (cp) without Symbolic Links

I want to copy my files but convert the symbolic links to hard links (ie. the actual file). How can I do this? Here's my code (that isn't working): cp -RL ${FROM_DIR} ${TO_DIR} Note: this is for ...
-2
votes
1answer
19 views

I have multiple installs of wordpress, all using the same plugins but in different locations. how can i use a symlink link to avoid duplication?

I have multiple installations of wordpress on my server, all using the same plugins but in different locations. i.e i have /home/site1/wp-content/plugins/plugin1 ...
1
vote
0answers
159 views

How do I search/replace symbolic links?

I've been having this issue for a long time, and I don't want to reinstall the whole system, yet. Now there's an app that runs on Java, and it doesn't even open. The logs says some cocoa files were ...
2
votes
1answer
345 views

Directory of dereferenced symbolic link?

In shell script, how can I dereference a symbolic link and get the directory of the file it links to?
1
vote
1answer
121 views

Unix (Debian) autocomplete paths thru symlinks

By default, directory symlinks on unix systems are treated as files as far as the autocomplete feature goes. For example, having a directory symlink at /srv/link/, typing /srv/liTAB does only complete ...
2
votes
5answers
1k views

Does ln -s require you to be in a certain directory?

I want to create a simple symlink to a file. It works perfectly if I run the command from inside the directory where I want the symlink to be created: /path/to/link $ ln -s /path/to/file . But if ...
20
votes
3answers
9k views

Does rm -f follow symbolic links?

I have a directory like this: $ ls -l total 899166 drwxr-xr-x 12 me scicomp 324 Jan 24 13:47 data -rw-r--r-- 1 me scicomp 84188 Jan 24 13:47 lod-thin-1.000000-0.010000-0.030000.rda ...
2
votes
1answer
2k views

How do I move a linked file on Unix?

I have a bunch of files in one directory and links to each one of those files in another directory. So ls -l looks something like this: lrwxrwxrwx 1 rembol rembol 89 Jan 25 10:00 copyright.txt ...
0
votes
1answer
1k views

Unix pipe: find | ln -s

I'm trying to symlink some php files using the following command: find `pwd` -name "*.php" | ln -s * /home/frankv/www/bietroboter.de/symlinks However, all the symlinks are broken because the little ...
1
vote
1answer
31 views

linking private documents in public directory

On an OS X server, I have some documents in /Users/me/Documents/here/ Permissions to /Users/me/Documents is set to drwxrwxr--. Permissions to /Users/me/Documents/here is set to drwxrwxr-x. I want ...
17
votes
1answer
16k views

How do file permissions apply to symlinks?

Let's say you have this structure: + directory -- file1 -- file2 -- file3 -> /tmp/file3 file3 is a link to another file3 somewhere else on the system. Now let's say I chmod 777 the directory ...
3
votes
1answer
119 views

Find symlink when 'find' hasn't worked

So I have a few utility scripts in my ~/scripts folder. They are all bash scripts, nothing amazing about that. One is named sfind.sh, the other is svn-add-all.sh. At some point, I created symlinks to ...
1
vote
0answers
108 views

Soft link to a Excel sheet created in Unix is displayed as a Folder in Window

Created a Softlink for a Excel sheet using the following command, in Unix shared file system. temp$ ln -s temp1/Main.xlsm Link.xlsm But when I view the temp directory in Windows, Link.xlsm appears ...
0
votes
2answers
353 views

Create a softlink for a file on two servers

I want to create a softlink for a file between two servers. The file is present on server1 and a softlink should be created for it on server2.
1
vote
1answer
596 views

rsync functionality wanted - but i need symlinks, not copies

Is there a way to perform what rsync does (compiles many directories into a single directory) - But instead of copying files/sub-directories I need it to create a directory with symlinks that point ...
1
vote
3answers
678 views

Move to the directory of a symbolic link

On a UNIX machine I in my current directory I create a symbolic link: > ln -s public_html/code/index.html Which creates a file locally named index.html. How can cd to the directory ...
5
votes
5answers
714 views

How to see the end of a long chain of symbolic links

Suppose I have a link that points to another link that points to another link, etc. way down the line. I'm not sure how many levels of links there are. What's the slick command line way to see the ...
2
votes
1answer
668 views

Accessing files obscured by filesystem mounted at non-empty directory

I wish to mount a volume/filesystem at a non-empty directory, yet still retain access to the directory's contents. Is this possible? I know that a filesystem can be mounted at a non-empty directory ...
0
votes
2answers
371 views

Can I link log files to my web directory var/www?

Can I link log files to my web directory var/www ? so I have var/www/logs And then remove reading permission to others in my unix link preferences ? By the way can I change links preferences ?
3
votes
1answer
150 views

Editing softlinked files in UNIX

Let's say I have file A, and using 'ln -s A B', I have B. When I open, edit and save B, now B is not symlink anymore. It's just a new copy of A. Is this expected behavior? I use Mac OS X, and I ...
4
votes
1answer
322 views

Unix: softlinks, hardlinks

I am somewhat confused what the differences between a softlink, and a hardlink are (on unix). It seems like a softlink is the same as a shortcut in windows or an alias on Mac OS X. (Can someone ...
9
votes
2answers
6k views

Finding all symbolic and hard links to a file on UNIX

If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?
6
votes
4answers
4k views

What are the advantages of symlinks over hard links and viceversa?

I understand the differences between symbolic and hard links, but I've never understood why choose one or the other.