Hadoop HDFS commands in Cheat sheet
Hadoop HDFS (Hadoop Distributed File System) is a core component of the Hadoop ecosystem. HDFS is designed to store large data sets in a distributed environment.
To View the printable PDF of this sheet
The following are some common HDFS commands:
- hdfs dfs -ls: List all the files and directories in the HDFS file system
- hdfs dfs -mkdir: Create a new directory in HDFS
- hdfs dfs -put: Copy a file from local file system to HDFS
- hdfs dfs -get: Copy a file from HDFS to the local file system
- hdfs dfs -cat: Display the content of a file in HDFS
- hdfs dfs -rm: Remove a file from HDFS
- hdfs dfs -rmdir: Remove an empty directory from HDFS
- hdfs dfs -cp: Copy a file from one directory to another within HDFS
- hdfs dfs -mv: Move a file from one directory to another within HDFS
- hdfs dfs -du: Display the space consumed by a file in HDFS.
These commands can be executed from the command line by prefixing them with “hdfs dfs”. Note that these commands are basic and there are many more advanced HDFS commands available.