目录

睡前读物第3期: 软链接的创建使用

软链接简介

软链接,又称为符号链接,是一种特殊的文件类型 它指向了另一个文件或是目录,相当于文件指针或是快捷方式。 通过软链接,可以更方便的管理文件系统中的数据。

在 Powershell 中创建软链接

New-Item -ItemType SymbolicLink -Path "path/to/link" -Target "path/to/file"

这样就会在 /path/to/link 的位置创建一个指向 path/to/file 的软链接 其中 -ItemType SymbolicLink 表示创建的类型是符号链接

在 Windows CMD 中创建软链接

mklink /D "path/to/link" "path/to/file"

在 Linux Bash 中创建软链接

ln -s "path/to/link" "path/to/file" 

其中 -s 表示创建的是符号链接而非硬链接

参考文献