How to Read Jpg From Hdfs Python
HDFS Commands: Hadoop Shell Commands to Manage HDFS
Last updated on May 22,2019 89.9K Views
HDFS Commands
In my previous blogs, I have already discussed what is HDFS, its features, and compages. The first stride towards the journeying to Big Data & Hadoop training is executing HDFS commands & exploring how HDFS works. In this blog, I will talk virtually the HDFS commands using which you tin access the Hadoop File Arrangement.
So, let me tell you the important HDFS commands and their working which are used almost often when working with Hadoop File System.
-
fsck
HDFS Command to check the wellness of the Hadoop file arrangement.
Command: hdfs fsck /
-
ls
HDFS Control to display the list of Files and Directories in HDFS.
Control: hdfs dfs –ls /
-
mkdir
HDFS Command to create the directory in HDFS.
Usage: hdfs dfs –mkdir /directory_name
Command: hdfs dfs –mkdir /new_edureka
Note: Hither nosotros are trying to create a directory named "new_edureka" in HDFS.
-
touchz
HDFS Command to create a file in HDFS with file size 0 bytes.
Usage: hdfs dfs –touchz /directory/filename
Command: hdfs dfs –touchz /new_edureka/sample
Note: Here we are trying to create a file named "sample" in the directory "new_edureka" of hdfs with file size 0 bytes.
-
du
HDFS Control to check the file size.
Usage: hdfs dfs –du –s /directory/filename
Control: hdfs dfs –du –s /new_edureka/sample
-
cat
HDFS Command that reads a file on HDFS and prints the content of that file to the standard output.
Usage: hdfs dfs –cat /path/to/file_in_hdfs
Control: hdfs dfs –cat /new_edureka/test
-
text
HDFS Control that takes a source file and outputs the file in text format.
Usage: hdfs dfs –text /directory/filename
Command: hdfs dfs –text /new_edureka/exam
-
copyFromLocal
HDFS Command to copy the file from a Local file system to HDFS.
Usage: hdfs dfs -copyFromLocal <localsrc> <hdfs destination>
Control: hdfs dfs –copyFromLocal /home/edureka/exam /new_edureka
Note: Hither the examination is the file nowadays in the local directory /home/edureka and later the command gets executed the examination file volition be copied in /new_edureka directory of HDFS.
-
copyToLocal
HDFS Command to copy the file from HDFS to Local File System.
Usage: hdfs dfs -copyToLocal <hdfs source> <localdst>
Command: hdfs dfs –copyToLocal /new_edureka/test /home/edureka
Note: Here test is a file nowadays in the new_edureka directory of HDFS and after the control gets executed the exam file volition be copied to local directory /dwelling house/edureka
-
put
HDFS Command to copy single source or multiple sources from local file arrangement to the destination file system.
Usage: hdfs dfs -put <localsrc> <destination>
Command: hdfs dfs –put /home/edureka/test /user
Note: The command copyFromLocal is similar to put command, except that the source is restricted to a local file reference.
-
become
HDFS Command to re-create files from hdfs to the local file system.
Usage: hdfs dfs -go <src> <localdst>
Command: hdfs dfs –go /user/test /habitation/edureka
Annotation: The command copyToLocal is similar to get command, except that the destination is restricted to a local file reference.
-
count
HDFS Command to count the number of directories, files, and bytes under the paths that match the specified file pattern.
Usage: hdfsdfs -count <path>
Command: hdfs dfs –count /user
-
rm
HDFS Control to remove the file from HDFS.
Usage: hdfs dfs –rm <path>
Command: hdfs dfs –rm /new_edureka/test
-
rm -r
HDFS Command to remove the unabridged directory and all of its content from HDFS.
Usage: hdfs dfs -rm -r <path>
Control: hdfs dfs -rm -r /new_edureka
-
cp
HDFS Command to copy files from source to destination. This command allows multiple sources besides, in which example the destination must be a directory.
Usage: hdfs dfs -cp <src> <dest>
Command: hdfs dfs -cp /user/hadoop/file1 /user/hadoop/file2
Control: hdfs dfs -cp /user/hadoop/file1 /user/hadoop/file2 /user/hadoop/dir
-
mv
HDFS Control to move files from source to destination. This command allows multiple sources every bit well, in which case the destination needs to exist a directory.
Usage: hdfs dfs -mv <src> <dest>
Command: hdfs dfs -mv /user/hadoop/file1 /user/hadoop/file2
-
expunge
HDFS Control that makes the trash empty.
Command: hdfs dfs -expunge
-
rmdir
HDFS Command to remove the directory.
Usage: hdfs dfs -rmdir <path>
Command: hdfs dfs –rmdir /user/hadoop
-
usage
HDFS Command that returns the help for an individual command.
Usage: hdfs dfs -usage <command>
Control: hdfs dfs -usage mkdir
Notation: By using usage command yous can get information about any command.
-
assistance
HDFS Command that displays help for given command or all commands if none is specified.
Command: hdfs dfs -assistance
This is the stop of the HDFS Commands weblog, I promise it was informative and yous were able to execute all the commands. For more HDFS Commands, you may refer Apache Hadoop documentation hither.
Now that you have executed the to a higher place HDFS commands, bank check out the Hadoop training by Edureka, a trusted online learning company with a network of more 250,000 satisfied learners spread across the world. The Edureka Large Data Hadoop Certification Training course helps learners become expert in HDFS, Yarn, MapReduce, Squealer, Hive, HBase, Oozie, Flume and Sqoop using real-fourth dimension utilize cases on Retail, Social Media, Aviation, Tourism, Finance domain.
Got a question for u.s.a.? Please mention it in the comments section and we will get back to y'all.
Source: https://www.edureka.co/blog/hdfs-commands-hadoop-shell-command
0 Response to "How to Read Jpg From Hdfs Python"
Postar um comentário