Hadoop Commands
Hadoop Commands
10. To send file from directory to other directory in hdfs – hadoop fs –cp source destination
11. To move to file within hdfs directory – hadoop fs –mv source destination
12. To check disk usage for each file in directory– hadoop fs –du source
14. To check is this directory or not – echo$? If answer is 0 then it means it is directory else not
18. To move file from local to hdfs – hadoop fs –moveFromLocal a2.txt destination/
19. Merge file in hdfs and copy it into local – hadoop fs –getmerge –nl filename filename
~/Desktop/
22. To check the directory,no. of file in that directory and size – hadoop fs –count
directoryname
23. To remove some file – hadoop fs –rm directory/filename
24. Size of file -- Hadoop fs –stat %b directory/filename %r for replication %g for group %u for
username %y for last modification
25. Hadoop fs – help any command work like man command in linux
30. Hadoop fs –truncate –w 100 filepathname – to reduce the size of lengthy long file
31. To add extra comment to the file – hadoop fs –setfattr –n ‘user.ap’ –v this is dummyfile
filepath