我在日期范围内运行了一组m/r报告,现在有一系列目录,如:
/user/michael/output/TrueListingSellThroughFromLeafCategory/{20120101,20120102,20120103,20120104,20120105,20120106,20120107}
/user/michael/output/TrueListingSellThroughFromLeafCategory/{20120108,20120109,20120110,20120111,20120112,20120113,20120114}
/user/michael/output/TrueListingSellThroughFromLeafCategory/{20120115,20120116,20120117,20120118,20120119,20120120,20120121}
我很难浏览这些目录。如果我试着 ls
其中之一,它将日期作为一个列表,并为每个日期查找不同的目录。如果我转义大括号,我会得到一个没有这样的文件或目录错误。如果我用%7b和%7d替换大括号,情况就类似了。
如果我通配符的水平,然后我可以浏览较低的:
/user/michael/output/TrueListingSellThroughFromLeafCategory/*
但如果能一次找回一个就好了!我该怎么做?
1条答案
按热度按时间zvokhttg1#
看起来你应该可以用regex操作符来修复它
?
```hadoop fs -ls /user/michael/output/TrueListingSellThroughFromLeafCategory/?20120101,20120102,20120103,20120104,20120105,20120106,20120107?
[cmenguy@localhost ~]$ hadoop fs -mkdir /tmp/{TEST}
[cmenguy@localhost ~]$ hadoop fs -put <(echo foo) /tmp/{TEST}/
[cmenguy@localhost ~]$ hadoop fs -ls /tmp/{TEST}
ls: Cannot access /tmp/{TEST}: No such file or directory.
[cmenguy@localhost ~]$ hadoop fs -ls '/tmp/{TEST}'
ls: Illegal file pattern: Expecting set closure character or end of range, or } for glob {TEST at 5
[cmenguy@localhost ~]$ hadoop fs -ls /tmp/?TEST?
Found 1 items
-rw-r--r-- 3 cmenguy supergroup 4 2013-01-24 05:59 /tmp/{TEST}/63