Can you tell me what this is in the area marked red?
If I want to change /media/files/tb-prod/files
to some other path, how would I do that?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityCan you tell me what this is in the area marked red?
If I want to change /media/files/tb-prod/files
to some other path, how would I do that?
files
is a symbolic link to /media/files/tb-prod/files
. When you access files
or anything inside it, you'll really access the path under /media
. Symbolic links are made and updated using the ln
command. This link could have been made with:
ln -s /media/files/tb-prod/files files
-s
means to make a symbolic link. To update a link, either delete the link and create it as above, or use the -f
option to ln
as well. If you are linking to a folder, you should include the -n
option:
ln -sfn /a/new/path files
This will replace the link with a new one pointing at /a/new/path
.
The -n
option is necessary when linking to a different target folder to avoid creating a sub-folder inside that symbolic link and instead replace the symbolic link completely.
rm /path/to/symlink
.
Jun 22, 2018 at 10:21
-n
does, even after reading the man page. linking to symlinks of directories seems to work without it.. Anyone know?
Jul 30, 2019 at 6:10
-n
is something I've been wanting for ages! Thank you for the clarification!
Jul 30, 2019 at 12:52