2

Possible Duplicate:
How to pass parameter to alias?

I am trying to shorten the find command, but getting an error:

$ alias f='find . -name $1 -print'
$ f JobConf.java

find: paths must precede expression: JobConf.java
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

How can I make this work?

0

1 Answer 1

6

Aliases are just simple replacements and don't work that way. You probably want a function, which do everything aliases can do and more.

f () { find . -name "$1" -print; }

Not the answer you're looking for? Browse other questions tagged .