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

后端 未结 7 1831
清酒与你
清酒与你 2021-02-13 07:21

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 08:09
    find ./ -name "*.plist"
    

    edit: hmm, i may have misunderstood the question! if you were crazy, how about emulating it via a shell script? i routinely keep random utility scripts in ~/.bin, and that's the first thing in my PATH. if you had a similar setup perhaps you could do something like: (untested!)

    #!/bin/sh
    # remapping find!
    CMD=`echo $1 | cut -c 1`
    if [ $CMD = '-' ]
    then
    # pwd search
      /usr/bin/find ./ $*
    else
    # regular find
      /usr/bin/find $*
    fi
    
    0 讨论(0)
提交回复
热议问题