I have a symlink with these permissions:
lrwxrwxrwx 1 myuser myuser 38 Aug 18 00:36 npm -> ../lib/node_modules/npm/bin/npm-cli.js*
The symlink is located in a .tar.gz archive. Now when I unpack the tar.gz archive using maven the symlink is no longer valid. I'm therefore trying to reconstruct the symlink. First I create the symlink using ln but how do I set the same permissions as the original symlink?
You can make a new symlink and move it to the location of the old link.
ln -s <new_location> npm2
mv -f npm2 npm
That will preserve the link ownership. Alternatively, you can use chown
to set the link's ownership manually.
chown -h myuser:myuser npm
On most systems, symlink permissions don't matter. When using the symlink, the permissions of the components of symlink's target will be checked. However, on some systems they do matter. MacOS requires read permission on the link for readlink
, and NetBSD's symperm
mount option forces link permissions checks on read and traversal. On those systems (and their relatives, including FreeBSD and OpenBSD) there is a equivalent -h
option to chmod
.
chmod -h 777 npm
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다