use of "ff" and "files" in alias


The default alias file in MacOSX contains the following:

ff find . -name !:1 -print
files find !:1 -type f -print

Could one of you unix guys explain what each of these commands do? I've looked at 'find' in the man pages, but I'm still mystified by the '!:1'.



The '!:1' is actually part of the alias (see the tcsh manpage for info, since those are tcsh aliases), where it substitutes the first argument from the ff into the find; for example, if you type in

ff test arguments

tcsh would expand the alias into

find . -name test -print

So ff is a simple 'find a file matching the first argument, starting in the current directory.'

The files alias finds all files (-type f) under the path given as the first argument.


And if you wanted to find a name 'fragment', it would be:

alias f find . -name "\*\!#:1\*" -follow

Really though, do a 'man tcsh' and read up on argument
expansions which are an extensive feature.