How to query the target of all aliases Finder?

Mac OSX 10.6

I have some aliases indicating the wrong volume. I would like to search the entire hierarchy for such aliases. These are aliases, not symbolic links, so I can't just do it find / -type l -ls | grep badVolumeName.

There seems to be com.apple.ResourceFork in the aliases, but requesting this with the help xattrgives me binary data. Is there a way to reset the target of the alias as text so that I can grep for the name of the bad volume? Or what other way to do it?

+3
source share
1 answer

To find alias files, you can use fooobar.com/questions/1793995 / ... . First create a script is_alias.sh:

#! /bin/bash
[ "$(mdls -raw -name kMDItemKind "$1")" = "Alias" ]

find . -type f -exec ./is_alias.sh {} \; -print

.

- MacPerl, MacPerl, , .

AskDifferent , , , . Applescript , , " " , .

, Cocoa.

+3

Source: https://habr.com/ru/post/1793993/


All Articles