Screenshot of terminal with symbolic link

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?

  • 1
    yea.. but i didnt know about symbolic link before thats why i added screenshot to someone help. and @michael homer answered me for that.
    – Jalil Khan
    Commented Aug 26, 2014 at 3:27
  • 4
    The other question should be marked as a duplicate of this one. This one is more useful.
    – mbomb007
    Commented Aug 31, 2020 at 18:10

1 Answer 1


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 the old target folder files and instead replace the symbolic link completely.

  • 3
    Example how to delete the symlink would be good Commented Apr 30, 2018 at 12:29
  • 12
    @AndrewAtkinson: you delete a symlink as if it's a normal file, with rm /path/to/symlink.
    – henrebotha
    Commented Jun 22, 2018 at 10:21
  • 3
    I don't understand what the -n does, even after reading the man page. linking to symlinks of directories seems to work without it.. Anyone know?
    – naught101
    Commented Jul 30, 2019 at 6:10
  • 14
    @naught101 It's not for linking to directories, it's for replacing links to directories instead of making a new link inside the directory. Commented Jul 30, 2019 at 6:14
  • 13
    @MichaelHomer AHHH!! I HATE that default behaviour. -n is something I've been wanting for ages! Thank you for the clarification!
    – naught101
    Commented Jul 30, 2019 at 12:52

Not the answer you're looking for? Browse other questions tagged .