rn/minesweeper/libs touch a rn/minesweeper/libs ln -s a b rn/minesweeper/libs ll total 0 -rw-r--r-- 1 hbb staff 0B 8 24 16:29 a lrwxr-xr-x 1 hbb staff 1B 8 24 16:29 b -> a rn/minesweeper/libs file b b: empty
不会提示是一个链接符号
刚才 file 看了输出正常就 rm -rf 了
在 linux 下 file 如果是链接符号 会提示一下
$ mkdir test $ touch a $ ln -s a b $ file b b: symbolic link to a
.git 都干没了
1 aloxaf 47 天前 zsh 没有内置的 file 命令吧? |
![]() | 3 chingyat 47 天前 via iPhone GNU 的命令行工具大多比 BSD 的好用 |
4 w568w 47 天前 macOS 的实现: https://github.com/apple-oss-distributions/file/blob/03da74dd39d8209bfe953306347a8c514e688025/file/src/fsmagic.c#L383 Linux 的(上游的)实现: https://github.com/file/file/blob/74e451be9d9e86af5e06e9795403017f8c6833ba/src/fsmagic.c#L375 没看出太大区别。两边应该都会打印符号链接。是版本问题? 另外不该依赖这个看符号链接的。 |
![]() | 6 zsh 没有内置 file 命令。 macos 中的很多命令跟 linux 的都有差别。比如 sed -i 就不一样。 |
7 cnbatch 47 天前 mac 的内置命令行工具应该很久都没更新过了,上游的工具都早已迭代了很多个版本 FreeBSD 的输出: b: symbolic link to a NetBSD 的输出: b: symbolic link to a OpenBSD 的输出: b: symbolic link to 'a' |