HADOOP FILE SYSTEM COMMANDS
In this blog post I will explain different HDFS commands to access HDFS which are commonly used while working as a Big Data Developer Training.
LS
Similar to Unix command, it is used for creating directories in HDFS
[npntraining@localhost ~] hdfs dfs -ls /
-mkdir
[npntraining@localhost ~] hdfs dfs -mkdir /dir01
– put
Copies files from local file system to HDFS. This is similar to -copyFromLocal command.
[npntraining@localhost ~] hdfs dfs sample.txt /dir01
Note :
Passing -f overwrites the destination if it already exists.
Passing -p preserves access and modification times, ownership and the mode.