How can I make the “find” Command on OS X default to the current directory?

后端 未结 7 1653
长情又很酷
长情又很酷 2021-02-13 07:43

I am a heavy command line user and use the find command extensively in my build system scripts. However on Mac OS X when I am not concentrating I often get output l

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 07:53

    If you must call it 'find', then you want:

    alias find=/usr/bin/find\ .
    

    in your .profile or .bash_profile or …. Substitute the real path (if not /usr/bin/find) on your Mac OSX. Enter the full path to avoid cycles (bash normally would interpret alias find=find without issues, but better be sure).

    But you better not name the alias find (findl, myfind etc), because it will become a habit and trouble for you if you try it on another system.

提交回复
热议问题