telling alias files from regular files from command line

Is there a way to distinguish an alias file (created by the Finder) from a “real” regular file from the command line (e.g. get the alias file recognized as a symbolic link)? Right now, my script uses shell scripts (ls, stat, grep, etc) in regard to all file-handling, except for the alias files. Having to call the Finder each time I read a directory kind of annoys me. Thanks in advance.

after some looking through man pages i got an idea…


you might be able to come up with something using this command:

this is the one i found to show alias’s different.
mdls -name kMDItemFSFinderFlags *

results where

I guess I could use mdls, as well as “mdfind -name kMDItemFSItemKind ‘Alias’ -onlyin ~/Desktop”. But this is much slower than simply calling the Finder. What I’m looking for is a faster way, where the ideal would be if you could simply run “find ~/Desktop -type l” to get a list including alias files as well as symbolic links. I thought that maybe “stat” would have some kind of optional parameter that I’m unaware of… Thanks anyway.