SlideShare a Scribd company logo
1 of 3
Download to read offline
Objective of Assignment:-
1-Create a new directory /hdfs_assignments on HDFS.
2. Upload geolocation.csv to /sics on HDFS.
3. Upload trucks.csv to /sics on HDFS after changing its name to trucks_file.csv
4. Rename the file geolocation.csv to geolocation_data.csv on HDFS using rename hdfs shell
command.
5. change the permission of hdfs_assignments folder to full read,write,execute to all users, groups
and others. (Hint: use chmod command)
6. Print the file content of geolocation_data.csv on Linux terminal.
7. Move the file geolocation_data.csv back to Desktop folder in local linux file system.
8. List all the files from /user/cloudera folder in HDFS and count the total entries. Hint : Redirection
Operator
9. Delete the folder and its content /sics on HDFS.
10. List all the files including its subdirectories and file lengths from /user/cloudera folder.
1-Create a new directory /hdfs_assignments on HDFS.
$HADOOP_HOME/bin/hdfs dfs -mkdir /hdfs_assignments
./hdfs dfs -mkdir /hdfs_assignments
./hdfs dfs -mkdir /sics
2. Upload geolocation.csv to /sics on HDFS.
$HADOOP_HOME/bin/hdfs dfs -put /home/saurabh/Documents/dubai/geolocation.csv /sics
./hdfs dfs -put /home/saurabh/Documents/dubai/geolocation.csv /sics
check the file
./hdfs dfs -ls /sics
3. Upload trucks.csv to /sics on HDFS after changing its name to trucks_file.csv
rename file in in linux/ubuntu
mv trucks.csv trucks_file.csv
Upload trucks.csv to /sics
./hdfs dfs -put /home/saurabh/Documents/dubai/trucks_file.csv /sics
check the file
./hdfs dfs -ls /sics
4. Rename the file geolocation.csv to geolocation_data.csv on HDFS using rename hdfs shell
command.
./hdfs dfs -mv /sics/geolocation.csv /sics/geolocation_data.csv
check the file
./hdfs dfs -ls /sics
5. change the permission of /sics folder to full read,write,execute to all users, groups and others.
(Hint: use chmod command)
check the Permission Before
./hdfs dfs -ls /sics
Change the permission
./hdfs dfs -chmod -R 777 /sics
check the Permission after changing
./hdfs dfs -ls /sics
6. Print the file content of geolocation_data.csv on Linux terminal.
Print 5 lines
./hdfs dfs -cat /sics/geolocation_data.csv | head -n 5
Print the whole output
./hdfs dfs -cat /sics/geolocation_data.csv
7. Move the file geolocation_data.csv back to Desktop folder in local linux file system.
./hdfs dfs -get /sics/geolocation_data.csv
/home/saurabh/Documents/dubai/geolocation_data_localcopy.csv
-Check folder for localcopy file
cd /home/saurabh/Documents/dubai/
ls
8. List all the files from /sics folder in HDFS and count the total entries. Hint : Redirection Operator
Total number of files: hadoop fs -ls /path/to/hdfs/* | wc -l
Total number of lines: hadoop fs -cat /path/to/hdfs/* | wc -l
Total number of lines for a given file: hadoop fs -cat /path/to/hdfs/filename | wc -l
./hdfs dfs -count /sics >> /home/saurabh/Documents/dubai/output.txt
./hdfs dfs -ls /sics/* | wc -l >> /home/saurabh/Documents/dubai/output1.txt
./hdfs dfs -cat /sics/* | wc -l
9. List all the files including its subdirectories and file lengths from /sics/ folder.
List all the files including its subdirectories
./hdfs dfs -ls -R /sics
all file size in folder
./hdfs dfs -du -h /sics/
File size in hdfs
./hdfs dfs -du -h /sics/geolocation_data.csv
10. Delete the folder and its content /sics on HDFS.
./hdfs dfs -rm -r /sics
./hdfs dfs -ls /sics
check wheather files or directory exits or Not
./hdfs dfs -ls /sics

More Related Content

What's hot

Cloud computing and service models
Cloud computing and service modelsCloud computing and service models
Cloud computing and service modelsPrateek Soni
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud ComputingLiming Liu
 
Unit 3 -Data storage and cloud computing
Unit 3 -Data storage and cloud computingUnit 3 -Data storage and cloud computing
Unit 3 -Data storage and cloud computingMonishaNehkal
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph DatabasesMax De Marzi
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jTobias Lindaaker
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network SecurityKathirvel Ayyaswamy
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key ExchangeSAURABHDHAGE6
 
Discovering the New SuccessFactors LMS Admin Features
Discovering the New SuccessFactors LMS Admin FeaturesDiscovering the New SuccessFactors LMS Admin Features
Discovering the New SuccessFactors LMS Admin FeaturesAshton Plusquellec
 
Data security in cloud computing
Data security in cloud computingData security in cloud computing
Data security in cloud computingPrince Chandu
 
Hybrid Cloud and Its Implementation
Hybrid Cloud and Its ImplementationHybrid Cloud and Its Implementation
Hybrid Cloud and Its ImplementationSai P Mishra
 
Cypher technique
Cypher techniqueCypher technique
Cypher techniqueZubair CH
 
DNS & DNSSEC
DNS & DNSSECDNS & DNSSEC
DNS & DNSSECAPNIC
 
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...Amazon Web Services
 
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingVTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingSachin Gowda
 

What's hot (20)

Cloud computing and service models
Cloud computing and service modelsCloud computing and service models
Cloud computing and service models
 
No sql
No sqlNo sql
No sql
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
 
Introduction to HBase
Introduction to HBaseIntroduction to HBase
Introduction to HBase
 
Unit 3 -Data storage and cloud computing
Unit 3 -Data storage and cloud computingUnit 3 -Data storage and cloud computing
Unit 3 -Data storage and cloud computing
 
Cloud Ecosystem
Cloud EcosystemCloud Ecosystem
Cloud Ecosystem
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4j
 
VLSM (1).ppt
VLSM (1).pptVLSM (1).ppt
VLSM (1).ppt
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key Exchange
 
AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3) AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3)
 
Discovering the New SuccessFactors LMS Admin Features
Discovering the New SuccessFactors LMS Admin FeaturesDiscovering the New SuccessFactors LMS Admin Features
Discovering the New SuccessFactors LMS Admin Features
 
Data security in cloud computing
Data security in cloud computingData security in cloud computing
Data security in cloud computing
 
Hybrid Cloud and Its Implementation
Hybrid Cloud and Its ImplementationHybrid Cloud and Its Implementation
Hybrid Cloud and Its Implementation
 
Cypher technique
Cypher techniqueCypher technique
Cypher technique
 
File permissions
File permissionsFile permissions
File permissions
 
DNS & DNSSEC
DNS & DNSSECDNS & DNSSEC
DNS & DNSSEC
 
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...
Best Practices for Building a Data Lake with Amazon S3 - August 2016 Monthly ...
 
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingVTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
 

Similar to Hdfs lab hands-on

Top 10 Hadoop Shell Commands
Top 10 Hadoop Shell Commands Top 10 Hadoop Shell Commands
Top 10 Hadoop Shell Commands SimoniShah6
 
Apache HDFS - Lab Assignment
Apache HDFS - Lab AssignmentApache HDFS - Lab Assignment
Apache HDFS - Lab AssignmentFarzad Nozarian
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFSApache Apex
 
Data science bootcamp day2
Data science bootcamp day2Data science bootcamp day2
Data science bootcamp day2Chetan Khatri
 
Hadoop Installation presentation
Hadoop Installation presentationHadoop Installation presentation
Hadoop Installation presentationpuneet yadav
 
5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTXMiguel720844
 
Configuring and manipulating HDFS files
Configuring and manipulating HDFS filesConfiguring and manipulating HDFS files
Configuring and manipulating HDFS filesRupak Roy
 
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...Leons Petražickis
 
Hadoop Architecture and HDFS
Hadoop Architecture and HDFSHadoop Architecture and HDFS
Hadoop Architecture and HDFSEdureka!
 
Hadoop installation steps
Hadoop installation stepsHadoop installation steps
Hadoop installation stepsMayank Sharma
 
Basic command of hadoop
Basic command of hadoopBasic command of hadoop
Basic command of hadoopAhmad Kabeer
 
Big data using Hadoop, Hive, Sqoop with Installation
Big data using Hadoop, Hive, Sqoop with InstallationBig data using Hadoop, Hive, Sqoop with Installation
Big data using Hadoop, Hive, Sqoop with Installationmellempudilavanya999
 
Hadoop File System.pptx
Hadoop File System.pptxHadoop File System.pptx
Hadoop File System.pptxAakashBerlia1
 

Similar to Hdfs lab hands-on (20)

HDFS_Command_Reference
HDFS_Command_ReferenceHDFS_Command_Reference
HDFS_Command_Reference
 
Top 10 Hadoop Shell Commands
Top 10 Hadoop Shell Commands Top 10 Hadoop Shell Commands
Top 10 Hadoop Shell Commands
 
Apache HDFS - Lab Assignment
Apache HDFS - Lab AssignmentApache HDFS - Lab Assignment
Apache HDFS - Lab Assignment
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFS
 
Hadoop File System Shell Commands,
Hadoop File System Shell Commands,Hadoop File System Shell Commands,
Hadoop File System Shell Commands,
 
Data science bootcamp day2
Data science bootcamp day2Data science bootcamp day2
Data science bootcamp day2
 
Hadoop Installation presentation
Hadoop Installation presentationHadoop Installation presentation
Hadoop Installation presentation
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX5c_BigData_Hadoop_HDFS.PPTX
5c_BigData_Hadoop_HDFS.PPTX
 
Configuring and manipulating HDFS files
Configuring and manipulating HDFS filesConfiguring and manipulating HDFS files
Configuring and manipulating HDFS files
 
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
IOD 2013 - Crunch Big Data in the Cloud with IBM BigInsights and Hadoop lab s...
 
MapReduce1.pptx
MapReduce1.pptxMapReduce1.pptx
MapReduce1.pptx
 
Hadoop Architecture and HDFS
Hadoop Architecture and HDFSHadoop Architecture and HDFS
Hadoop Architecture and HDFS
 
Hadoop installation steps
Hadoop installation stepsHadoop installation steps
Hadoop installation steps
 
BIGDATA ANALYTICS LAB MANUAL final.pdf
BIGDATA  ANALYTICS LAB MANUAL final.pdfBIGDATA  ANALYTICS LAB MANUAL final.pdf
BIGDATA ANALYTICS LAB MANUAL final.pdf
 
Basic command of hadoop
Basic command of hadoopBasic command of hadoop
Basic command of hadoop
 
Run wordcount job (hadoop)
Run wordcount job (hadoop)Run wordcount job (hadoop)
Run wordcount job (hadoop)
 
Interacting with hdfs
Interacting with hdfsInteracting with hdfs
Interacting with hdfs
 
Big data using Hadoop, Hive, Sqoop with Installation
Big data using Hadoop, Hive, Sqoop with InstallationBig data using Hadoop, Hive, Sqoop with Installation
Big data using Hadoop, Hive, Sqoop with Installation
 
Hadoop File System.pptx
Hadoop File System.pptxHadoop File System.pptx
Hadoop File System.pptx
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Hdfs lab hands-on

  • 1. Objective of Assignment:- 1-Create a new directory /hdfs_assignments on HDFS. 2. Upload geolocation.csv to /sics on HDFS. 3. Upload trucks.csv to /sics on HDFS after changing its name to trucks_file.csv 4. Rename the file geolocation.csv to geolocation_data.csv on HDFS using rename hdfs shell command. 5. change the permission of hdfs_assignments folder to full read,write,execute to all users, groups and others. (Hint: use chmod command) 6. Print the file content of geolocation_data.csv on Linux terminal. 7. Move the file geolocation_data.csv back to Desktop folder in local linux file system. 8. List all the files from /user/cloudera folder in HDFS and count the total entries. Hint : Redirection Operator 9. Delete the folder and its content /sics on HDFS. 10. List all the files including its subdirectories and file lengths from /user/cloudera folder. 1-Create a new directory /hdfs_assignments on HDFS. $HADOOP_HOME/bin/hdfs dfs -mkdir /hdfs_assignments ./hdfs dfs -mkdir /hdfs_assignments ./hdfs dfs -mkdir /sics 2. Upload geolocation.csv to /sics on HDFS. $HADOOP_HOME/bin/hdfs dfs -put /home/saurabh/Documents/dubai/geolocation.csv /sics ./hdfs dfs -put /home/saurabh/Documents/dubai/geolocation.csv /sics check the file ./hdfs dfs -ls /sics 3. Upload trucks.csv to /sics on HDFS after changing its name to trucks_file.csv rename file in in linux/ubuntu mv trucks.csv trucks_file.csv Upload trucks.csv to /sics ./hdfs dfs -put /home/saurabh/Documents/dubai/trucks_file.csv /sics check the file ./hdfs dfs -ls /sics
  • 2. 4. Rename the file geolocation.csv to geolocation_data.csv on HDFS using rename hdfs shell command. ./hdfs dfs -mv /sics/geolocation.csv /sics/geolocation_data.csv check the file ./hdfs dfs -ls /sics 5. change the permission of /sics folder to full read,write,execute to all users, groups and others. (Hint: use chmod command) check the Permission Before ./hdfs dfs -ls /sics Change the permission ./hdfs dfs -chmod -R 777 /sics check the Permission after changing ./hdfs dfs -ls /sics 6. Print the file content of geolocation_data.csv on Linux terminal. Print 5 lines ./hdfs dfs -cat /sics/geolocation_data.csv | head -n 5 Print the whole output ./hdfs dfs -cat /sics/geolocation_data.csv 7. Move the file geolocation_data.csv back to Desktop folder in local linux file system. ./hdfs dfs -get /sics/geolocation_data.csv /home/saurabh/Documents/dubai/geolocation_data_localcopy.csv -Check folder for localcopy file cd /home/saurabh/Documents/dubai/ ls 8. List all the files from /sics folder in HDFS and count the total entries. Hint : Redirection Operator Total number of files: hadoop fs -ls /path/to/hdfs/* | wc -l Total number of lines: hadoop fs -cat /path/to/hdfs/* | wc -l Total number of lines for a given file: hadoop fs -cat /path/to/hdfs/filename | wc -l ./hdfs dfs -count /sics >> /home/saurabh/Documents/dubai/output.txt ./hdfs dfs -ls /sics/* | wc -l >> /home/saurabh/Documents/dubai/output1.txt ./hdfs dfs -cat /sics/* | wc -l
  • 3. 9. List all the files including its subdirectories and file lengths from /sics/ folder. List all the files including its subdirectories ./hdfs dfs -ls -R /sics all file size in folder ./hdfs dfs -du -h /sics/ File size in hdfs ./hdfs dfs -du -h /sics/geolocation_data.csv 10. Delete the folder and its content /sics on HDFS. ./hdfs dfs -rm -r /sics ./hdfs dfs -ls /sics check wheather files or directory exits or Not ./hdfs dfs -ls /sics