如何使用Mac Finder列出文件夹中的所有别名 [英] How to use Mac Finder to list all aliases in a folder

查看:362
本文介绍了如何使用Mac Finder列出文件夹中的所有别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Bitbucket.org下载了一个zip文件作为存储库,并使用iZip将其解压缩到了Mac. Xcode发现许多编译错误,因为zip或unzip不能正确保留别名.所以我用hg克隆了仓库,别名被保留了,然后Xcode编译就干净了.我想在我的文件夹中找到所有别名,并用它们的目标替换它们,以便将来使用zip.我已经做了很多搜索,找不到任何说明如何使用Mac Finder实用程序或bash find命令找到它们的内容.我试过使用Finder->所有我的文件和search-> kind-> other-> alias,它可以找到大约100个别名,但是找不到我所知道的本地存储库中的别名.我是否需要以某种方式重建/更新所有文件的OSX 10.9.1索引列表? find命令是否具有OSX别名文件类型的标志?我可以将Finder导航到文件夹,然后递归搜索文件类型(如果未选择所有我的文件",则搜索条件选项似乎消失了).另一种选择是打印出完整的Finder列表的内容,并在其中显示种类"列,然后按此排序.

I downloaded a repository from Bitbucket.org as a zip file and unzipped it using iZip to my Mac. Xcode found many compile errors because the zip or unzip did not preserve aliases properly. So I used hg to clone the repo, the aliases were preserved, and the Xcode compile was then clean. I would like to find all the aliases in my folder and replace them by their targets so future zips will work. I've done a lot of searching and can't find anything that says how find them either with the Mac Finder utility or the bash find command. I've tried using Finder->All My Files with search->kind->other->alias and it finds about 100 aliases but not the ones in my local repo that I know are there. Do I need to rebuild/update the OSX 10.9.1 index list of all my files somehow? Does the find command have a flag for OSX alias file types? Can I navigate Finder to a folder and then search recursively for a file type (the search criteria option seems to disappear if All My Files is not selected). Another alternative would be to print to file the contents of a full Finder list with the "Kind" column showing and then sort by that.

mdfind "kMDItemKind == 'Alias'" -onlyin /path/of/repo

似乎可以使用mdfind.但是它只能找到与Finder->带有搜索->种类->其他->别名的所有我的文件相同的文件.这些文件和我的存储库中的文件在Finder中被列为别名".我读过有3种类型的链接:别名,符号链接和硬链接. ls命令列出了mdfind命令找到的文件:

Seems like mdfind might work. But it only finds the same files that Finder->All My Files with search->kind->other->alias finds. Those files and the ones in my repo are listed as Kind "Alias" by Finder. I've read that there are 3 kinds of links: Alias, Symbolic Links, and Hard Links. The listing by the ls command for a file found by the mdfind command is:

-rw-r--r--@ 1 kenm staff 45100 Dec 25 2012 GTLDrive.h

ls命令列出的我要查找的文件是:

The listing by the ls command for a file I would like to find is:

lrwxr-xr-x 1 kenm staff 24 Jan 14 21:38 Headers -> ./Versions/A/Headers

Finder称它们均为别名",但ls认为它们是不同的.是否有mdfind命令行找到第二种别名?

Finder calls them both "Alias" but ls thinks they are different. Is there an mdfind command line that finds the second type of Alias?

推荐答案

在终端机中:

这应该找到所有aliases(Apple别名)

This should find all aliases (Apple aliases)

mdfind "kMDItemKind == 'Alias'" -onlyin /path/of/your/repo

要查找所有symlinks(符号链接),可以使用:

For finding all symlinks (symbolic links) you can use:

ls -lR /path/of/your/repo | grep ^l

仅显示当前目录中的符号链接:

To only show symlinks in current directory:

ls -la | grep ^l

如果要查看符号链接的完整路径:

If you want to view the full path of symlinks:

find /path/of/your/repo -type l

这篇关于如何使用Mac Finder列出文件夹中的所有别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆