What's the standard way to create files in your hdfs filesystem? What's the standard way to create files in your hdfs filesystem? hadoop hadoop

What's the standard way to create files in your hdfs filesystem?


Well, it's so easy.

hdfs dfs -mkdir /test

was created successfully.

hdfs dfs -put myFile /test/myFile

works as well.


Create a directory:

hdfs dfs -mkdir directoryName

Create a new file in directory

hdfs dfs -touchz directoryName/Newfilename

Write into newly created file in HDFS

nano filename

Save it Cntr+X Y

Read the newly created file from HDFS

nano fileName

Or

hdfs dfs -cat directoryName/fileName


HDFS is a non POSIX compliant file systems so you can't edit files directly inside of HDFS, however you can Copy a file from your local system to HDFS using following command:

hdfs dfs -put /path/in/source/system/filename /path/in/HDFS/system/destination