Tag Info

Hot answers tagged

32

It's not a bug. The use case is for when you want to link a file to the same basename but in a different directory: cd /tmp ln -s /etc/passwd ls -l passwd lrwxrwxrwx 1 xxx xxx 11 Jul 29 09:10 passwd -> /etc/passwd It's true that when you do this with a filename that is in the same directory it creates a link to itself which does not do a whole lot of ...


7

On a Linux system, when changing the ownership of a symbolic link using chown, by default it changes the target of the symbolic link (ie, whatever the symbolic link is pointing to). If you'd like to change ownership of the link itself, you need to use the -h option to chown: -h, --no-dereference affect each symbolic link instead of any referenced ...


6

The easiest way to find out of course, is to try it and see. When no 2nd argument is given, ln will create a link in the current directory with the same name as the original: $ ln -s /etc $ ls -l lrwxrwxrwx 1 terdon terdon 4 Jul 29 16:09 etc -> /etc This is also explained in man ln: In the 2nd form, create a link to TARGET in the current ...


3

Also note that the error you gave above ln: creating symbolic link `/etc/init.d/jboss1': Permission denied is not due to the owner of the symlink being somebody else than the owner of the original file. It is (most probably) caused by user askar not having write access to the directory /etc/init.d.


3

dpkg is apparently intended to support this, so go ahead with the symlinks :). W.r.t. bind-mounts: just say no. dpkg won't be able to handle them gracefully, e.g. if a directory is changed on upgrade. They're treated as separate by fatrace so it's harder to monitor writes to individual devices. (Technically that's probably a quirk of the kernel ...


3

No, because there is no standard Linux distribution. Linux is just a kernel, and doesn't specify anything about user-space, including file layout. If you want to narrow this down to a subset of Linux distributions, you might be able to find something (with, as you note, /bin/sh as a good candidate) However, the kernel itself does have some special ...


2

When acting on symlinks, you must tell most of the tools (chown, chmod, ls...) not to dereference the link: you must add the -h parameter, as stated in the manpage : -h, --no-dereference affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink) So try : sudo chown -h askar.admin ...


2

It's not available as part of standard Unix or a graphical Linux interface. Linux system administrators can use overlayfs. Actually one of the most important uses is to allow modifications to a running LiveCD system, e.g. installing extra packages. There are also equivalents in FUSE, which can be used on Linux without root privileges. There will be ...


1

When you did the ls -il /usr/bin, you were listing file names and matching inode numbers. In this context, it's probably best to think of "file name" as separate from "inode", and to think of the inode as the file. The "inode" is typically an on-disk data structure containing metadata (permissons, ownership, creation time, access time, etc) and the disk ...


1

I have no idea what the best approach is and elegance is certainly in the eye of the beholder, but I use the following for my dotfiles: A ~/.dotfiles directory that contains all of the dotfiles themselves. These are all managed in a git repo. A script, also in ~/.dotfiles that creates the required links into my home directory. I don't have any dotfiles in ...


1

I would advise leaving the mount in its default location and using a cross drive sym / soft link. Only change mount points from defaults if that's the only place you'll want to access the drive.


1

You can also look into readlinkat(..), it handles more error scenario's than readlink(..)


1

It is operating system specific. On Linux and POSIX, consider readlink & readlinkat & lstat (and stat for symlinks without existing targets) & symlink & unlink ... Maybe realpath(3) & access(2) & faccessat & basename(3) might be helpful to you. Perhaps POCO & Glib/GObject/GIO from GTK are offering wrappers working on both ...


1

You have an extra backslash in your symbolic link. The actual path is /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl but you created a symbolic link to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl When you use the text of the symbolic link in the shell, the backslash is interpreted as an escape character, so you get ...


1

0xC0000022L's answer is thorough for the Windows side of things. The Mac can recognize Linux's symlinks; however Linux cannot recognize aliases made in the Mac's Finder (symlinks created using ln -s work fine).



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