Using junction and mklink in windows to create soft links in linux

Source: Internet
Author: User
Tags microsoft website

Windows can also implement soft links and hard links in linux, which can be implemented through junction and mklink.

Junction

Soft links can also be called symbolic links, similar to ln-s in unix.

In fact, windows also has this function, but windows does not seem to have a built-in symbolic connection tool. The most useful tool should be the Sysinternals package on the Microsoft website, which contains a large volume of programs, in which junction.exe is used to manage symbolic connections.

The symbolic link folder created by junction does not occupy any disk space. It only points to the source folder.

Http://technet.microsoft.com/en-us/sysinternals/bb896768

Applicable environment

Must be in NTFS format

Windows XP +

Windows server 2003 +

Download and Install

Address: http://download.sysinternals.com/files/Junction.zip

Decompress junction.zipto junction.exe and directly throw it to C: WINDOWSsystem32.

Usage:

Using Junction

Use junction to list junctions:

Usage: [-s]

-S Recurse subdirectories

Examples:

To determine if a file is a junction, specify the file name:

Junction c: test

To list junctions beneath a directory, include the-s switch:

Junction-s c:

To create a junction c: Program-Files for "c: Program Files ":

C:> md Program-Files

C:> junction c: Program-Files "c: Program Files"

To delete a junction, use the-d switch:

Junction-d c: Program-Files

Milking

Download Address: http://technet.microsoft.com/zh-cn/library/cc753194 (WS.10). aspx

Create a symbolic link.

For examples of how to use this command, see examples.

Syntax

Mklink [[/d] | [/h] | [/j]

Parameters

/D: create a symbolic link to the directory. By default, the symbolic link of the file is created in mklink.
/H creates a hard link instead of a symbolic link.
/J.
<Link> specifies the name of the symbolic Link being created.
<Target> specify the path (relative or absolute) to which the new symbolic link points ).
/? Display help at a command prompt.

Example

To create a symbolic link named MyDocs from the root directory to the UsersUser1Documents Directory, type:

Mklink/d MyDocs UsersUser1Documents

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.