by
What are Hadoop HDFS Commands?

1 Answer

0 votes
by

A)version:  hadoop version

interviewbit:~$ hadoop version
Hadoop 3.1.2
Source code repository https://github.com/apache/hadoop.git -r
Compiled by sunlig on 2019-01-29T01:39Z
interviewbit:~$

B) mkdir: Used to create a new directory.

interviewbit:~$ hadoop FD -mkdir/interviewbit 
interviewbit:~$ 

C) cat: We are using the cat command to display the content of the file present in the directory of HDFS.
hadoop fs –cat /path_to_file_in_hdfs

interviewbit:~$ hadoop fs -cat/interviewbit/sample  
Hello from InterviewBit…
File in HDFS …
interviewbit:~$

D)mv : The HDFS mv command moves the files or directories from the source to a destination within HDFS.
hadoop fs -mv <src> <dest>

interviewbit:~$ hadoop fs -ls/
Found 2 Items
drwxv -xv -x - interviewbit supergroup 0 2020-01-29:11:11/ Intr1
drwxv -xv -x - interviewbit supergroup 0 2020-01-29:11:11/ Interviewbit
interviewbit:~$ hadoop fs -mv/ Intr1/ Interviewbit
interviewbit:~$ hadoop fs -ls/
Found 1 Item
drwxv -xv -x - interviewbit supergroup 0 2020-01-29:11:11/ Interviewbit

E) copyToLocal: This command copies the file from the file present in the newDataFlair directory of HDFS to the local file system.
hadoop fs -copyToLocal <hdfs source> <localdst>

interviewbit:~$ hadoop fs -copyFromLocal -/test1/interviewbit/CopyTest
interviewbit:~$ 

F) get: Copies the file from the Hadoop File System to the Local File System.
hadoop fs -get<src> <localdest>

interviewbit:~$ hadoop fs - get/testFile ~/copyFromHadoop
interviewbit:~$  

Related questions

0 votes
    Why are blocks in HDFS huge?...
asked Aug 5, 2021 by JackTerrance
0 votes
    Are they same? In my view "hadoop fs" command shows the hdfs files and the "hdfs dfs" command shows the local files, why is that? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    What are the types of Znode?...
asked Aug 3, 2021 by JackTerrance
0 votes
    What are main the YARN components?...
asked Aug 3, 2021 by JackTerrance
0 votes
    What is DistCp?...
asked Aug 5, 2021 by JackTerrance
0 votes
    List the components of Apache Spark?...
asked Aug 2, 2021 by JackTerrance
0 votes
    What is shuffling in MapReduce?...
asked Aug 2, 2021 by JackTerrance
0 votes
    What are the main differences between HDFS (Hadoop Distributed File System ) and Network Attached Storage(NAS) ?...
asked Aug 2, 2021 in Technology by JackTerrance
0 votes
    Can someone tell me what is the basic difference between HBase and Hadoop? I have done my own research but I ... in Layman terms. Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    Can someone tell me what is the basic difference between HBase and Hadoop? I have done my own research ... and answers pdf, Verbal Reasoning interview questions for beginners...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    What is the Storage Unit In Hadoop (HDFS)?...
asked Aug 2, 2021 in Technology by JackTerrance
0 votes
    What are the different Features of HDFS?...
asked Aug 2, 2021 in Technology by JackTerrance
0 votes
    What are the mandatory configurations needed in order to connect to HDFS?...
asked Mar 23, 2021 in Technology by JackTerrance
0 votes
    By default the records from databases imported to HDFS by sqoop are A - Tab separated B - Concatenated columns C - space separated D - comma separated...
asked Jan 13, 2021 in Technology by JackTerrance
0 votes
    When I run the server using php bin/console server:run I get the following error. There are no ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
...