Challenge - 5 Problems
HDFS CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this HDFS command?
Given the HDFS command
hdfs dfs -ls /user/hadoop, what will it display?Hadoop
hdfs dfs -ls /user/hadoop
Attempts:
2 left
💡 Hint
The command uses '-ls' which is similar to the Unix 'ls' command but for HDFS.
✗ Incorrect
The 'hdfs dfs -ls' command lists files and directories in the specified HDFS path with detailed information.
❓ data_output
intermediate2:00remaining
What is the result of this HDFS command?
What will be the result of running
hdfs dfs -mkdir /user/hadoop/newdir if the directory already exists?Hadoop
hdfs dfs -mkdir /user/hadoop/newdir
Attempts:
2 left
💡 Hint
Think about what happens when you try to create a directory that already exists in HDFS.
✗ Incorrect
The 'hdfs dfs -mkdir' command fails with an error if the directory already exists.
🔧 Debug
advanced2:00remaining
Identify the error in this HDFS command
What error will this command produce?
hdfs dfs -put localfile.txt /user/hadoop/ when localfile.txt does not exist locally.Hadoop
hdfs dfs -put localfile.txt /user/hadoop/
Attempts:
2 left
💡 Hint
The command tries to upload a file that does not exist locally.
✗ Incorrect
The 'hdfs dfs -put' command fails with a FileNotFoundException if the local file does not exist.
🧠 Conceptual
advanced2:00remaining
What does the HDFS command
hdfs dfs -du -h /user/hadoop show?Choose the correct description of the output of
hdfs dfs -du -h /user/hadoop.Attempts:
2 left
💡 Hint
The '-du' option is similar to Unix 'du' command but for HDFS.
✗ Incorrect
The 'hdfs dfs -du -h' command shows disk usage of files/directories with sizes in human-readable units.
🚀 Application
expert3:00remaining
Which command sequence correctly copies a local directory to HDFS and verifies the copy?
You want to copy a local directory
data/ to HDFS path /user/hadoop/data/ and then list the contents to verify. Which sequence of commands is correct?Attempts:
2 left
💡 Hint
Remember that the target directory must exist before copying if you want to keep the directory structure.
✗ Incorrect
First create the target directory, then copy the local directory into it, then list contents to verify.