【问题标题】:Hadoop fs test command with wildcard characters带有通配符的 Hadoop fs 测试命令
【发布时间】:2019-01-23 19:18:00
【问题描述】:

我想检查 hdfs 路径上是否存在遵循模式的文件。我正在尝试使用以下命令:

hadoop fs -test -e /user/foo/bar/abc*

但它的抛出错误:

test: `/user/foo/bar/abc*': No such file or directory

根据以下问题,我尝试同时使用双引号和单引号,但问题仍然相同: Hadoop HDFS copy with wildcards?

hadoop fs -test -e  "/user/foo/bar/abc*"
test: `/user/foo/bar/abc*': No such file or directory
hadoop fs -test -e  '/user/foo/bar/abc*'
test: `/user/foo/bar/abc*': No such file or directory

【问题讨论】:

    标签: hadoop hdfs


    【解决方案1】:

    在有通配符或需要扩展的情况下,您需要引用(双引号)文字或路径。

    试试这个... hadoop fs -test -e "/user/foo/bar/abc*"

    【讨论】:

    • 这不是命令的正确使用。如果您想查看文件是否存在,为什么不直接使用带有完整 URI 的文件名而不是通配符?
    猜你喜欢
    • 1970-01-01
    • 2013-08-31
    • 1970-01-01
    • 1970-01-01
    • 2013-11-15
    • 2013-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多