0% found this document useful (0 votes)
10 views2 pages

579 BDA Week-03

Uploaded by

alluarjunrrrr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

579 BDA Week-03

Uploaded by

alluarjunrrrr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Roll No: 21R21A0579 Name: Ch.

Vamshi
Experiment No: 03 Experiment Name: HDFS File System Commands
Date Of Experiment: 05-09-2024 Course Name: Big Data Analytics Lab

PROBLEM STATEMENT:- Example:


Hadoop File System Commands hadoopfs-rm/user/saurzcode/dir1/abc.txt

1. Create a directory in HDFS at given Usage:


path(s). hadoopfs-cat<path[filename]>
Example:
Usage: hadoopfs-cat/user/saurzcode/dir1/abc.txt
hadoopfs-mkdir<paths>
Example: 5. Copy a file from source to destination
hadoopfs- This command allows multiple sources as well in
mkdir/user/saurzcode/dir1/user/saurzcode/dir2 which case the destination must be a directory.
Usage:
2. List the contents of a directory. hadoopfs-cp<source><dest>
Example:
Usage : hadoopfs-
hadoopfs-ls<args> cp/user/saurzcode/dir1/abc.txt/user/saurzcode/dir2
Example:
hadoopfs-ls/user/saurzcode 6. Copy a file from/To Local file system to
HDFS
3. Upload and download a file in HDFS.
copyFromLocal
Usage : Usage:
hadoop fs -put: hadoopfs-copyFromLocal<localsrc>URI
Example:
Copy single src file, or multiple src files from hadoopfs-
local file system to the Hadoop data file system copyFromLocal/home/saurzcode/abc.txt/user/saur
zcode/abc.txt
Usage: Similar to put command, except that the source is
hadoopfs-put<localsrc> ... <HDFS_dest_Path> restricted to a local file reference.
Example: copyToLocal
hadoopfs-
put/home/saurzcode/Samplefile.txt/user/saurzco Usage:
de/dir3/ hadoopfs-copyToLocal [-ignorecrc] [-crc]
URI<localdst>
Download: Similar to get command, except that the
destination is restricted to a local file reference.
hadoop fs -get:
7. Move file from source to destination.
Copies/Downloads files to the local file system Note:- Moving files across filesystem is not
permitted.
Usage: Usage :
hadoopfs-get<hdfs_src><localdst> hadoopfs-mv<src><dest>
Example: Example:
hadoopfs- hadoopfs-
get/user/saurzcode/dir3/Samplefile.txt/home/

4. See contents of a file


Same as unix cat command:
hadoopfs-rm<arg>
Roll No: 21R21A0579 Name: Ch. Vamshi
Experiment No: 03 Experiment Name: HDFS File System Commands
Date Of Experiment: 05-09-2024 Course Name: Big Data Analytics Lab

mv/user/saurzcode/dir1/abc.txt/user/saurzcode/di
r2

8. Remove a file or directory in HDFS.

Remove files specified as argument. Deletes


directory only when it is empty

Usage :
hadoopfs-rm<arg>

Example:
hadoopfs-rm/user/saurzcode/dir1/abc.txt

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy