HDFS Commands PDF
HDFS Commands PDF
1. **What command is used to list all files and directories in a specific location in HDFS?**
- `hdfs dfs -ls /`
4. **What command is used to copy a file from the local filesystem to HDFS?**
- `hdfs dfs -put /local/path/to/file.txt /hdfs/path`
8. **What command is used to move a file from the local filesystem to HDFS?**
- `hdfs dfs -moveFromLocal /local/path/to/file.txt /hdfs/path`
9. **What command is used to copy a file from one directory to another within HDFS?**
- `hdfs dfs -cp /hdfs/source/path/file.txt /hdfs/destination/path`
10. **What command is used to move a file from one directory to another in HDFS?**
- `hdfs dfs -mv /hdfs/source/path/file.txt /hdfs/destination/path`
11. **What command checks the size of individual files and directories?**
- `hdfs dfs -du /hdfs/path`
14. **What command is used to copy a file from HDFS to the local filesystem?**
- `hdfs dfs -get /hdfs/path/to/file.txt /local/path`
20. **What command recursively deletes all files and directories in HDFS?**
- `hdfs dfs -rm -r /hdfs/path`