Hot answers tagged

62

A hard link traditionally shares the same file system structures (inode in unixspeak), while a soft-link is a pathname redirect. Hardlinks must be on the same filesystem, softlinks can cross filesystems. Hardlinked files stay linked even if you move either of them (unless you move one to another file system triggering the copy-and-delete mechanism). ...


30

You can store symlinks as symlinks (as opposed to a copy of the file/directory they point to) using the --symlinks parameter of the standard zip. Assuming foo is a directory containing symlinks: zip --symlinks -r foo.zip foo/ Rar equivalent: rar a -ol foo.rar foo/ tar stores them as is by default. tar czpvf foo.tgz foo/ Note that the symlink ...


21

Symlinks are purely symbolic: they contain nothing but a path, so when you open a symlink, the OS reads the path and uses that instead. In a chroot environment, links (especially ones with absolute paths) typically don't point to the same place they pointed to in the normal environment. If the server OS is Linux, your best bet is to bind-mount the entire ...


10

The summary is that a symbolic / short link acts as a shortcut to the first file's location, whereas a hardlink is a shortcut to the file on the disk. If you delete the target of a soft link then the soft link will cease to work, but if you delete one copy of a hard link, the file will remain on the disk until all hard links to it are removed. In effect all ...


9

You should be able to use pwd -P tony@matrix:/var/vhosts$ pwd /var/vhosts tony@matrix:/var/vhosts$ pwd -P /srv/data/vhosts


8

I don't think you will find a more feature-rich and well-documented utility/add-on than Hermann Schinagl's Link Shell Extensions found here: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html Truly everthing else that I have read and used pales by comparison.


8

I had a very similar problem. Like you, I was unable to follow symlinks under my home directory even though I had the FollowSymlinks enabled plus I could ls around with my http user, but putting symlinks under /srv/http worked just fine... I fixed it by chmod'ing my home directory to be executable: chmod +x /home/mgalgs And that did it for me! Maybe try ...


8

It works! On Windows by default only administrators can create symlinks. When I start VirtualBox as administrator, I can create symlinks without any problems. In order to be able to create symlinks without starting the VB as admin, you need to set this permission for your user/usergroup. Here is a short how-to. The only problem is -- I have not found a ...


7

From the chcon(1) man page: -h, --no-dereference affect symbolic links instead of any referenced file


6

I noticed you add git as a tag--it sounds like /home/ubuntu/etc-config is a git repository with all your configs in it. In which case, it sounds like you're trying to manage configuration files from a central location. If that's the case, I highly recommend looking for a real solution. Take a look at something like puppet, chef, cfengine, or any of the ...


6

May I answer with a question? Assuming you're on a RedHat/CentOS install here... ls /etc/httpd/ # should return something like: # conf conf.d logs modules run cd /etc/httpd/logs/ # Why does this next command fail? ls ../conf # ls: cannot access ../conf: No such file or directory # But this next command works? cd ../conf The short answer is ...


5

You can't, there is only 1 directory. You need to unlink the folder and link just the files or subfolders apart from the one that needs to be different.


5

A small note, is that you could use ln both times to make the command not actually move the data (assuming both paths are on the same filesystem). ln /some/path/file /another/path/ && ln -sf /another/path/file /some/path/ But I assume that you want to move the content of /some/path/ to an other disk, and then create links to the new files so "no ...


4

Unfortunately no. All information about a symlink is stored within the symlink itself, therefore it's impossible to find without scanning the entire filesystem.


4

Is SELinux enabled on this server? I wonder if this is stopping apache from loading this symlink correctly?


4

I don't think that there is a FTP daemon which can circumvent the chroot(2) syscall. And if there was such a daemon, I wouldn't use it because it opens a lot of security holes. What's the point chrooting the users anyway if you want them to access the whole file system (through manipulated symbolic links)?


4

On RHEL 5, we have $ zip -h Copyright (C) 1990-2005 Info-ZIP Type 'zip "-L"' for software license. Zip 2.31 (March 8th 2005). Usage: zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list] (snip) -y store symbolic links as the link instead of the referenced file


4

I'm not with Rackspace, but having worked for a hosting provider I can give you one general piece of advice: If your provider says something to the effect of "We can't guarantee that X will work" and you elect to do it anyway you are outside of anyone's ability to support you. If it works, "Hey that's great! We're really happy for you!" If it stops ...


4

From the Apache 2 documentation, For security reasons, Apache will follow symbolic links only if the Options setting for the relevant directory includes FollowSymLinks or SymLinksIfOwnerMatch. So you need to make sure you have FollowSymLinks in the Options setting, probably as part of the <Directory> container. For example, <Directory /...


4

That's not how symbolic links work. (So the answer to your question is "No", at least not with symbolic links.) What you are looking for is called a Union Mount - I'm not aware of any way to accomplish this on Windows, though it may be possible and I've just never seen it...


4

. indicates the current directory. Once you cd to a symlink, you are in the destination directory. What you are seeing is not an error, or a problem of any kind. This is how symlinks work in unix systems. If you want to see the symlink when you list files, then stay in the parent directory where the actual symlink exists.


4

While it doesn't keep them separate, etckeeper does a very good job of tracking changes to config files. Keeping the repository off of the box somewhere would make it easy to restore those changes to a new machine.


4

You could use the realpath command in the deployment guide to ensure the instructions are generic but apply the contexts to the real filesystem location where ever that may actually be be. `realpath "/opt/product/wwwstatic"`


4

Amazon S3 is not a file system. You cannot just mount it to your EC2 instance like a regular disk or EBS. It now follows that a symlink is not possible. You can however use s3fs to mount your S3 bucket as a directory in your EC2 server. I used this tutorial and I was able to successfully mount my S3 to my EC2 running on Ubuntu 14.04. WARNING You are ...


3

Would this information lead to a solution? From man rsync: . . . If you want to duplicate a server-side symlink, include both the symlink via its path, and referent directory via its real path. . . . It is also possible to limit the amount of path information that is sent as implied directories for each ...


3

No, I have never had problems doing that, and I done that on many machines. If for some reason you didn't want to use a symlink then you could just do a bind mount.


3

NTFS Link provides an explorer extension for creating hard links.


3

An alias contains two pieces of information: a unique identifier of the file it links to, and the path and file name of the file it links to. If you rename or move a file, and then create a new file with the path and file name that the file originally had, then any alias that linked to the original file now links to the new file. However, if you rename or ...


3

Yes, that's a symbolic link. The reason you're unable to create one is you're using the wrong syntax: you're using ls instead of ln, and also ln wants the name of the existing file (or directory) as its first parameter, and the name of the symbolic link to create as the second one. In your case, the right command would be ln -s /storage/thumbs thumbs.



Only top voted, non community-wiki answers of a minimum length are eligible