“非法选项"在macOS上使用Find时出现错误 [英] "Illegal option" error when using find on macOS

查看:109
本文介绍了“非法选项"在macOS上使用Find时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试仅在文件末尾列出字母"R".我在macOS Terminal中按如下方式使用了find

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' 

但是我收到消息说illegal option --t.

推荐答案

find的第一个参数是它应该开始查找的路径.路径.表示当前目录.

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'

这篇关于“非法选项"在macOS上使用Find时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆