简体   繁体   中英

Hadoop 'cat' command error

I am quite new to hadoop and I am having some issues using this type of platform. Everytime I run the cat command in Linux , it would always return with " No such file or directory "

For Example

I would enter:

$ hadoop fs -cat filename | head

cat: 'filename': No such file or directory

Can anyone help me fix this issue?

Thanks

Seems, there is no file with name filename .

Hadoop fs commands take path from HDFS. Here filename should be a valid HDFS path.

To view your file in HDFS you can use ls command

[terminal~]hadoop fs -ls <filename>
[terminal~]hadoop fs -ls <Parent directory of filename>

If file is present, it will be listed. Then you can use cat command like this :

hadoop fs -cat hdfs://nn1.example.com/file1 
hadoop fs -cat file:///file3 /user/hadoop/file4

Please refer Hadoop commands for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM