Using an alias in find -exec
问题 I have a very long command in bash, which I do not want to type all the time, so I put an alias in my .profile alias foo='...' Now I want to execute this alias using find -exec find . -exec foo '{}' \; but find cannot find foo: find: foo: No such file or directory Is it possible to use an alias in find? 回答1: Nope, find doesn't know anything about your aliases. Aliases are not like environment variables in that they aren't "inherited" by child processes. You can create a shell script with the