You can use the following HDFS Command to create a file in the Hadoop file system of file size 0 bytes.
Usage: hdfs dfs –touchz /directory/filename
Command: hdfs dfs –touchz /new_directory/sample
Note: With the above commands, we can create a file named “sample” in the directory “new_directory” of hdfs with file size 0 bytes.
If you want to learn Hadoop, I recommend this Hadoop Training program by Intellipaat.
You can check out this YouTube tutorial on Hadoop to know more: