Assuming that you have already copied files to VM and you are logged into VM (linux), the command you should be using is:
hdfs dfs -copyFromLocal <local-linux-path> <hdfs-path>
If you don't have your home directory created on HDFS, then create it first using:
hdfs dfs -mkdir -p /user/madhav/
The path you are giving in the command you have shown looks wrong to me. It should look something like:
hdfs dfs -copyFromLocal /home/madhav/file.txt /user/madhav/
Then you can check your file on hdfs with:
hdfs dfs -ls /user/madhav/
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.