SlideShare a Scribd company logo
3
Most read
4
Most read
7
Most read
BASIC COMMAND OF HADOOP
~presented by ahmad
AGENDA
• LS
• MKDIR
• TOUCHZ
• COPYFROMLOCAL (OR) PUT
• CAT
• COPYTOLOCAL (OR) GET
• MOVEFROMLOCAL
• CP
• MV
• RMR
• DU
• DUS
• STAT
• SETREP
ls :This command is used to list all the files. Use lsr for recursive approach. It is
useful when we want a hierarchy of a folder.
Syntax : bin/hdfs dfs -ls <path>
Example: bin/hdfs dfs -ls /
mkdir: To create a directory. In Hadoop dfs there is no home directory by
default. So let’s first create it.
Syntax: bin/hdfs dfs -mkdir <folder name>
creating home directory:
hdfs/bin -mkdir /user
hdfs/bin -mkdir /user/username -> write the username of your computer
Example : bin/hdfs dfs -mkdir /ahmad => '/' means absolute path
Touchz : It creates an empty file.
Syntax: bin/hdfs dfs -touchz <file_path>
Example: bin/hdfs dfs -touchz /geeks/myfile.txt
copyFromLocal (or) put: To copy files/folders from local file system
to hdfs store. This is the most important command. Local filesystem means the
files present on the OS.
Syntax: bin/hdfs dfs -copyFromLocal <local file path> <dest(present on hdfs)>
Example: bin/hdfs dfs -put ../Desktop/AI.txt /ahmad
cat: To print file contents.
Syntax: bin/hdfs dfs -cat <path>
Example: bin/hdfs dfs -cat /geeks/AI.txt ->
copyToLocal (or) get: To copy files/folders from hdfs store to local file
system.
Syntax: bin/hdfs dfs -copyToLocal <<srcfile(on hdfs)> <local file dest>
Example: bin/hdfs dfs -get /geeks/myfile.txt ../Desktop/hero
moveFromLocal: This command will move file from local to hdfs.
Syntax: bin/hdfs dfs -moveFromLocal <local src> <dest(on hdfs)>
Example: bin/hdfs dfs -moveFromLocal ../Desktop/cutAndPaste.txt /geeks
cp: This command is used to copy files within hdfs. Lets copy folder geeks to
geeks_copied.
Syntax: bin/hdfs dfs -cp <src(on hdfs)> <dest(on hdfs)>
Example: bin/hdfs -cp /geeks /geeks_copied
mv: This command is used to move files within hdfs. Lets cut-paste a file
myfile.txt from geeks folder to geeks_copied.
Syntax : bin/hdfs dfs -mv <src(on hdfs)> <src(on hdfs)>
Example: bin/hdfs -mv /geeks/myfile.txt /geeks_copied
rmr: This command deletes a file from HDFS recursively. It is very useful
command when you want to delete a non-empty directory.
Syntax : bin/hdfs dfs -rmr <filename/directoryName>
Example: bin/hdfs dfs -rmr /geeks_copied
du: It will give the size of each file in directory.
Syntax : bin/hdfs dfs -du <dirName>
Example: bin/hdfs dfs -du /geeks
dus: This command will give the total size of directory/file.
Syntax: bin/hdfs dfs -dus <dirName>
Example: bin/hdfs dfs -dus /geeks
stat: It will give the last modified time of directory or path. In short it will give
stats of the directory or file.
Syntax: bin/hdfs dfs -stat <hdfs file>
Example: bin/hdfs dfs -stat /geeks
setrep: This command is used to change the replication factor of a
file/directory in HDFS. By default it is 3 for anything which is stored in HDFS (as
set in hdfs core-site.xml).
Syntax: bin/hdfs dfs -setrep -R -w 6 geeks.txt
Example: bin/hdfs dfs -setrep -R 4 /geeks

More Related Content

PDF
Unix for Librarians
PDF
Hadoop File System Shell Commands,
PDF
Linux Basic Commands
PDF
HDFS_Command_Reference
PPTX
Hadoop Interacting with HDFS
PDF
Basic Linux commands
PDF
Basic linux commands for bioinformatics
PPTX
Compression
Unix for Librarians
Hadoop File System Shell Commands,
Linux Basic Commands
HDFS_Command_Reference
Hadoop Interacting with HDFS
Basic Linux commands
Basic linux commands for bioinformatics
Compression

What's hot (20)

PPT
Empacotamento e backport de aplicações em debian
PPT
Compression Commands in Linux
PPTX
12 linux archiving tools
PDF
Using the command line on macOS
PPTX
Top 10 Hadoop Shell Commands
PPT
Basic command ppt
PPT
Linux Commands
DOCX
Directories description
PDF
Linux basic for CADD biologist
PDF
Hdfs lab hands-on
ODP
Rpm Introduction
PDF
Course 102: Lecture 24: Archiving and Compression of Files
PDF
Basic linux commands
PPTX
Linux basics
DOCX
Basic linux commands
PDF
The Linux Command Cheat Sheet
PDF
3.1.a linux commands reference
PDF
Archlinux install
PDF
Cli1 Bibalex
PDF
One Page Linux Manual
Empacotamento e backport de aplicações em debian
Compression Commands in Linux
12 linux archiving tools
Using the command line on macOS
Top 10 Hadoop Shell Commands
Basic command ppt
Linux Commands
Directories description
Linux basic for CADD biologist
Hdfs lab hands-on
Rpm Introduction
Course 102: Lecture 24: Archiving and Compression of Files
Basic linux commands
Linux basics
Basic linux commands
The Linux Command Cheat Sheet
3.1.a linux commands reference
Archlinux install
Cli1 Bibalex
One Page Linux Manual
Ad

Similar to Basic command of hadoop (20)

PPTX
5c_BigData_Hadoop_HDFS.PPTX
PDF
Hadoop-HDFS-commands.pdf hadoop commands
PDF
394753714-hdfc-command-biga data tecnology
PDF
an detailed notes on Hadoop_Shell_Commands.pdf
PDF
Interacting with hdfs
DOCX
Hadoop basic commands
PPTX
Linux comands for Hadoop
PDF
BIGDATA ANALYTICS LAB MANUAL final.pdf
PDF
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
PPTX
Hadoop & HDFS for Beginners
PDF
Big data-cheat-sheet
PDF
General apache command for hadoop
PDF
Hadoop operations basic
PDF
Big data using Hadoop, Hive, Sqoop with Installation
PDF
Apache Hadoop Shell Rewrite
PPTX
Hdfs connector api
PPTX
Hadoop Installation presentation
PDF
RHive tutorial - HDFS functions
PDF
Basic unix commands
PPTX
Linux commands presentation topic discrete structure.ppt
5c_BigData_Hadoop_HDFS.PPTX
Hadoop-HDFS-commands.pdf hadoop commands
394753714-hdfc-command-biga data tecnology
an detailed notes on Hadoop_Shell_Commands.pdf
Interacting with hdfs
Hadoop basic commands
Linux comands for Hadoop
BIGDATA ANALYTICS LAB MANUAL final.pdf
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
Hadoop & HDFS for Beginners
Big data-cheat-sheet
General apache command for hadoop
Hadoop operations basic
Big data using Hadoop, Hive, Sqoop with Installation
Apache Hadoop Shell Rewrite
Hdfs connector api
Hadoop Installation presentation
RHive tutorial - HDFS functions
Basic unix commands
Linux commands presentation topic discrete structure.ppt
Ad

Recently uploaded (20)

PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPT
Quality review (1)_presentation of this 21
PPTX
Computer network topology notes for revision
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PDF
Foundation of Data Science unit number two notes
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
Clinical guidelines as a resource for EBP(1).pdf
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
Fluorescence-microscope_Botany_detailed content
PDF
annual-report-2024-2025 original latest.
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPT
Reliability_Chapter_ presentation 1221.5784
Galatica Smart Energy Infrastructure Startup Pitch Deck
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
STUDY DESIGN details- Lt Col Maksud (21).pptx
Qualitative Qantitative and Mixed Methods.pptx
Quality review (1)_presentation of this 21
Computer network topology notes for revision
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Foundation of Data Science unit number two notes
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Clinical guidelines as a resource for EBP(1).pdf
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
climate analysis of Dhaka ,Banglades.pptx
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Fluorescence-microscope_Botany_detailed content
annual-report-2024-2025 original latest.
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Reliability_Chapter_ presentation 1221.5784

Basic command of hadoop

  • 1. BASIC COMMAND OF HADOOP ~presented by ahmad
  • 2. AGENDA • LS • MKDIR • TOUCHZ • COPYFROMLOCAL (OR) PUT • CAT • COPYTOLOCAL (OR) GET • MOVEFROMLOCAL • CP • MV • RMR • DU • DUS • STAT • SETREP
  • 3. ls :This command is used to list all the files. Use lsr for recursive approach. It is useful when we want a hierarchy of a folder. Syntax : bin/hdfs dfs -ls <path> Example: bin/hdfs dfs -ls / mkdir: To create a directory. In Hadoop dfs there is no home directory by default. So let’s first create it. Syntax: bin/hdfs dfs -mkdir <folder name> creating home directory: hdfs/bin -mkdir /user hdfs/bin -mkdir /user/username -> write the username of your computer Example : bin/hdfs dfs -mkdir /ahmad => '/' means absolute path
  • 4. Touchz : It creates an empty file. Syntax: bin/hdfs dfs -touchz <file_path> Example: bin/hdfs dfs -touchz /geeks/myfile.txt copyFromLocal (or) put: To copy files/folders from local file system to hdfs store. This is the most important command. Local filesystem means the files present on the OS. Syntax: bin/hdfs dfs -copyFromLocal <local file path> <dest(present on hdfs)> Example: bin/hdfs dfs -put ../Desktop/AI.txt /ahmad cat: To print file contents. Syntax: bin/hdfs dfs -cat <path> Example: bin/hdfs dfs -cat /geeks/AI.txt ->
  • 5. copyToLocal (or) get: To copy files/folders from hdfs store to local file system. Syntax: bin/hdfs dfs -copyToLocal <<srcfile(on hdfs)> <local file dest> Example: bin/hdfs dfs -get /geeks/myfile.txt ../Desktop/hero moveFromLocal: This command will move file from local to hdfs. Syntax: bin/hdfs dfs -moveFromLocal <local src> <dest(on hdfs)> Example: bin/hdfs dfs -moveFromLocal ../Desktop/cutAndPaste.txt /geeks cp: This command is used to copy files within hdfs. Lets copy folder geeks to geeks_copied. Syntax: bin/hdfs dfs -cp <src(on hdfs)> <dest(on hdfs)> Example: bin/hdfs -cp /geeks /geeks_copied
  • 6. mv: This command is used to move files within hdfs. Lets cut-paste a file myfile.txt from geeks folder to geeks_copied. Syntax : bin/hdfs dfs -mv <src(on hdfs)> <src(on hdfs)> Example: bin/hdfs -mv /geeks/myfile.txt /geeks_copied rmr: This command deletes a file from HDFS recursively. It is very useful command when you want to delete a non-empty directory. Syntax : bin/hdfs dfs -rmr <filename/directoryName> Example: bin/hdfs dfs -rmr /geeks_copied du: It will give the size of each file in directory. Syntax : bin/hdfs dfs -du <dirName> Example: bin/hdfs dfs -du /geeks
  • 7. dus: This command will give the total size of directory/file. Syntax: bin/hdfs dfs -dus <dirName> Example: bin/hdfs dfs -dus /geeks stat: It will give the last modified time of directory or path. In short it will give stats of the directory or file. Syntax: bin/hdfs dfs -stat <hdfs file> Example: bin/hdfs dfs -stat /geeks setrep: This command is used to change the replication factor of a file/directory in HDFS. By default it is 3 for anything which is stored in HDFS (as set in hdfs core-site.xml). Syntax: bin/hdfs dfs -setrep -R -w 6 geeks.txt Example: bin/hdfs dfs -setrep -R 4 /geeks