输入 pig -x local 此时pig和本地的文件系统交互
省略 “-x local”,pig和hdfs交互
1、在pig中执行HDFS的命令
grunt> fs -ls /
Found 5 items
drwxr-xr-x - root supergroup 0 2013-01-30 14:32 /data
drwxr-xr-x - root supergroup 0 2013-01-25 19:07 /hbase
drwxr-xr-x - root supergroup 0 2013-01-30 17:03 /tmp
drwxr-xr-x - root supergroup 0 2013-01-30 16:44 /user
drwxr-xr-x - root supergroup 0 2013-01-25 09:21 /usr
cat filename 打印文件的内容
copyFromLocal localfile hdfsfile 拷贝本地文件到hdfs
copyToLocal hdfsfile localfile
rmr filename 删除文件
此外还有HDFS基本的 命令:chgrp,chmod, chown, cp, du, ls, mkdir, mv, rm, stat
2、grunt控制pig作业
kill jobid
exec “参数“ script
run ”参数“ script
标签:shell,drwxr,supergroup,pig,01,xr,grunt,2013 From: https://blog.51cto.com/u_16088628/6225133