To create a link to an existing file, type the following command:
ln <link> <file>
where: link is the name of the link to be created and file is the name of the file the link will point to, for example:
ln c:\my_links\contacts.doc c:\my_files\contacts.doc
This command will create the link named contacts.doc
in folder c:\my_links
, pointing to the file contacts.doc
placed in folder c:\my_files
.
If the link was successfully created, following information will be displayed:
SUCCESS: hard link created: c:\my_links\contacts.doc --> c:\my_files\contacts.doc
If any error occurs, following error message will be displayed:
ERROR: creating hard link failed: c:\my_links\contacts.doc --> c:\my_files\contacts.doc
To create a link to existing directory, type the following command:
ln <link> <directory>
where: link is the name of the link to be created and directory is the name of directory the link will point to, for example:
ln c:\my_links\my_dir c:\my_files\my_dir
This command will create the link named my_dir
in folder c:\my_links
, pointing to the directory my_dir
placed in folder c:\my_files
.
If the link was successfully created, following information will be displayed:
SUCCESS: junction created: c:\my_links\my_dir --> c:\my_files\my_dir
If any error occurs, an error message will be displayed.
To remove any link type the following command:
ln -r <link>
where link
is the name of existing link, pointing to file or to directory.
This is the preferred way the links should be removed, do not remove links by deleting them manually, especially using Explorer.