d:\symTest>del src.txt d:\symTest>dir Volume in drive D is Data Volume Serial Number is 68F9-EDFA Directory of d:\symTest 07:52 PM. In our example, let's delete the original file.
That's because symlink is just a shortcut of the original file. 07:32 PM dest.txt 12:03 AM 9 src.txt 2 File(s) 9 bytes 2 Dir(s) 63,305,105,408 bytes free As seen above the symlink shows no file size, whereas, the original file shows as 9 bytes. After I did the same: d:\symTest>mkLink dest.txt src.txt symbolic link created for dest.txt > src.txt d:\symTest>dir Volume in drive D is Data Volume Serial Number is 68F9-EDFA Directory of d:\symTest 07:32 PM. 12:03 AM 9 src.txt 1 File(s) 9 bytes 2 Dir(s) 63,305,269,248 bytes free The file content: d:\symTest>type src.txt some text To create a symbolic link you must start the cmd as administrator. Creating Symbolic link: Our example src file: d:\symTest>dir Volume in drive D is Data Volume Serial Number is 68F9-EDFA Directory of d:\symTest 12:03 AM.It's like a shortcut link to the original file. We can read/edit the linked file just like the original one.
Symbolic link and hard link, both point to some other file/folder at the different locations. Target Specifies the path (relative or absolute) that the new link refers to.
Link Specifies the new symbolic link name. H Creates a hard link instead of a symbolic link. MKLINK | | ] Link Target /D Creates a directory symbolic link.
In this tutorial, we will understand symbolic/hard links by showing examples on windows 10 using mklink command.