Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

bash - "Illegal option" error when using find on macOS

I am trying to list the files only with the letter "R" at the end. I used find as follows in macOS Terminal,

find -type f -name '*R' 

But I got the message saying illegal option --t.

question from:https://stackoverflow.com/questions/25840713/illegal-option-error-when-using-find-on-macos

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The first argument to find is the path where it should start looking. The path . means the current directory.

find . -type f -name '*R'

You must provide at least one path, but you can actually provide as many as you want:

find ~/Documents ~/Library -type f -name '*R'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...