Skip to content

Instantly share code, notes, and snippets.

@fishyer
Last active October 14, 2023 14:12
Show Gist options
  • Save fishyer/24cab6f0354229b8bb346ad996e26cba to your computer and use it in GitHub Desktop.
Save fishyer/24cab6f0354229b8bb346ad996e26cba to your computer and use it in GitHub Desktop.

meme.md

hook://file/XMKyhIUEL?p=RG9jdW1lbnRzLy5hcmNoaXZl&n=inbox

/Users/yutianran/Documents/.archive/inbox

用命令行创建文件夹的软链接

在/Users/yutianran/.hard_link 中创建文件夹/Users/yutianran/Documents/.archive/inbox 的软链接,名称保持一致

ln -s ~/Documents/.archive/inbox ~/.hard_link/inbox mv ~/Documents/.archive/inbox ~/Downloads/inbox ll ~/.hard_link/inbox

mount --bind ~/Documents/.archive/inbox ~/.hard_link/inbox

创建替身

cd ~/Documents/.archive ln -s ~/Downloads/test/inbox ~/Downloads/inbox.alias ll ~/Downloads cp -r inbox.alias ~/Downloads/...

测试文件链接

/Users/yutianran/Downloads/link/myfile cd /Users/yutianran/Downloads/link touch myfile && echo "my file first line" > myfile ln myfile hard # 创建一个硬连接文件 hard ln -s myfile soft # 创建一个软连接文件 soft

通过 AppleScript 创建替身

osascript -e 'tell application "Finder" to make alias file to POSIX file "/Users/yutianran/Downloads/link/myfile" at POSIX file "/Users/yutianran/Downloads"' osascript -e 'tell application "Finder" to make alias file to POSIX file "/Users/yutianran/Downloads/link/myfile" at POSIX file "/Users/yutianran/Downloads/link" as "myfile-fake"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment