A symlink is deleted like any other file regardless of what it points to. All you should have to do is:
If foldername is a symlink, changing ownership of it isn't going to do anything. You need to change ownership of the file or directory the symbolic link points to.
Hi,
Is there a limit to the number of symbolic links you can have?
I tried to vi the symbolic link relating to a file and got the following error:
"filename" Too many levels of symbolic links
There is only one symbolic link to one file in this case, but there are >2000 other links to... (2 Replies)
Hi,
- we have copy (cp command) to do to save all the contents of a dty BUT we dont want to copy the files corresponding to symbolic links contained whithin this dty
- the box is a sun solaris one - and the cp commande do not say avything about that?
thanks for help
Jakez (7 Replies)
I am linking a directory as follows:
ln -sf /home/xxx/userid/real_files/* /home/xxx/userid/linked_files
This gives me symbolic links for all the files in the real_files directory in the linked_files directory. My question is, if I go and remove a file in the real_files directory and then go... (1 Reply)
Hi Guys...
I want to create a link using ln -s for a directory that does not exist on the box.
How do I do that?
I had some files from Box A directory /d1/u01 and I copied the files across to another Box lets say Box B on directory /d2/u02.
Now I want a link so that this path /d1/u01... (2 Replies)
I've just started using UNIX in a Linux vmplayer. I'm trying to run the command:
ln -s `pwd`/$1 `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/$1
in a script from an online tutorial, but I keep getting an error message:
ln: creating symbolic link... (1 Reply)
Hi,
I have a file with more than 1 layers of soft links for it. For ex.
ls -la .profile
.profile@ -> /home/act/.profile_abc
ls -la
/home/act/.profile_abc@ -> .profile_final
I want to get the name of the last file (i.e. .profile_final) when I refer to .profile using shell script. I... (2 Replies)
SYMLINK(2) Linux Programmer's Manual SYMLINK(2)NAME
symlink - make a new name for a file
SYNOPSIS
#include <unistd.h>
int symlink(const char *oldpath, const char *newpath);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
symlink():
_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200112L
DESCRIPTION
symlink() creates a symbolic link named newpath which contains the string oldpath.
Symbolic links are interpreted at run time as if the contents of the link had been substituted into the path being followed to find a file
or directory.
Symbolic links may contain .. path components, which (if used at the start of the link) refer to the parent directories of that in which
the link resides.
A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent one; the latter case is known as a dangling
link.
The permissions of a symbolic link are irrelevant; the ownership is ignored when following the link, but is checked when removal or renam-
ing of the link is requested and the link is in a directory with the sticky bit (S_ISVTX) set.
If newpath exists it will not be overwritten.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EACCES Write access to the directory containing newpath is denied, or one of the directories in the path prefix of newpath did not allow
search permission. (See also path_resolution(7).)
EEXIST newpath already exists.
EFAULT oldpath or newpath points outside your accessible address space.
EIO An I/O error occurred.
ELOOP Too many symbolic links were encountered in resolving newpath.
ENAMETOOLONG
oldpath or newpath was too long.
ENOENT A directory component in newpath does not exist or is a dangling symbolic link, or oldpath is the empty string.
ENOMEM Insufficient kernel memory was available.
ENOSPC The device containing the file has no room for the new directory entry.
ENOTDIR
A component used as a directory in newpath is not, in fact, a directory.
EPERM The file system containing newpath does not support the creation of symbolic links.
EROFS newpath is on a read-only file system.
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
NOTES
No checking of oldpath is done.
Deleting the name referred to by a symlink will actually delete the file (unless it also has other hard links). If this behavior is not
desired, use link(2).
SEE ALSO ln(1), lchown(2), link(2), lstat(2), open(2), readlink(2), rename(2), symlinkat(2), unlink(2), path_resolution(7), symlink(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2010-09-20 SYMLINK(2)