Recall & Review
beginner
What is the purpose of the HDFS command line interface?
The HDFS command line interface allows users to interact with the Hadoop Distributed File System to manage files and directories, such as creating, deleting, and viewing files.
Click to reveal answer
beginner
Which command lists files and directories in HDFS?
The command
hdfs dfs -ls lists files and directories in the current or specified HDFS directory.Click to reveal answer
beginner
How do you copy a file from the local file system to HDFS?
Use the command
hdfs dfs -put <local_path> <hdfs_path> to copy a file from your local machine to HDFS.Click to reveal answer
intermediate
What command removes a file or directory in HDFS?
The command
hdfs dfs -rm <path> removes a file, and hdfs dfs -rm -r <path> removes a directory recursively in HDFS.Click to reveal answer
beginner
How can you display the contents of a file stored in HDFS?
Use
hdfs dfs -cat <hdfs_file_path> to print the contents of a file stored in HDFS to the terminal.Click to reveal answer
Which command shows the files in the root directory of HDFS?
✗ Incorrect
The command
hdfs dfs -ls / lists files and directories in the root directory of HDFS.How do you copy a file named 'data.txt' from local to HDFS directory '/user/hadoop/'?
✗ Incorrect
The
-put command copies files from local to HDFS.Which command removes a directory and all its contents in HDFS?
✗ Incorrect
The
-rm -r command removes directories recursively.What does the command
hdfs dfs -cat /file.txt do?✗ Incorrect
The
-cat command prints the file content to the terminal.Which command copies a file from HDFS to the local file system?
✗ Incorrect
The
-get command copies files from HDFS to local.Explain how to list, add, and remove files in HDFS using the command line interface.
Think about commands for viewing, uploading, and deleting files.
You got /3 concepts.
Describe the difference between the commands hdfs dfs -put and hdfs dfs -get.
Consider the direction of file transfer.
You got /2 concepts.