In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Brief introduction:
The HDFS file system provides quite a number of shell operation commands, which greatly facilitates programmers and system managers to view and modify files on HDFS. Further, the name and format of HDFS's operation commands are quite consistent with those of Unix/Linux 's commands, so the cost of learning HDFS commands is greatly reduced. 1. Command help [hadoop@hadoop000 ~] $hdfs dfsUsage: hadoop fs [generic options] [- appendToFile...] [- cat [- ignoreCrc]...] [- checksum...] [- chgrp [- R] GROUP PATH...] [- chmod [- R] PATH...] [- chown [- R] [OWNER] [: [GROUP]] PATH... ] [- copyFromLocal [- f] [- p] [- l] [- d]...] [- copyToLocal [- f] [- p] [- ignoreCrc] [- crc]...] [- count [- Q] [- h] [- v] [- t []] [- u] [- x]...] [- cp [- f] [- p |-p [topax] [- d]...] [- createSnapshot []] [- deleteSnapshot] [- df [- h] [...]] [- du [- s] [- h] [- x]...] [- expunge] [- find...] [- get [- f] ] [- p] [- ignoreCrc] [- crc]...] [- getfacl [- R]] [- getfattr [- R] {- n name |-d} [- e en]] [- getmerge [- nl] [- skip-empty-file]] [- help [cmd...]] [- ls [- C] [- d] [- h] [- Q] [- R] [- t] [- S] [- r] [- u] [..] [- mkdir [- p].] [- moveFromLocal...] [- moveToLocal] [- mv.] [- put [- f] [- p] [- l] [- d]. ] [- renameSnapshot] [- rm [- f] [- r |-R] [- skipTrash] [- safely]...] [- rmdir [--ignore-fail-on-non-empty]...] [- setfacl [- R] [{- b |-k} {- m |-x}] | [--set]] [- setfattr {- n name [- v value] | |-x name}] [- setrep [- R] [- w].] [- stat [format].] [- tail [- f]] [- test-[defsz]] [- text [- ignoreCrc].] [- touchz.] [- truncate [- w].] [ -usage [cmd...] # Note: hdfs dfs is equivalent to hadoop fs2. File manipulation command case
Hdfs dfs-copyFromLocal / local/data / hdfs/data: upload local files to hdfs (the original path can only be one file)
Hdfs dfs-put / tmp/ / hdfs/: different from copyFromLocal, the original path of put can be a folder, etc.
Hadoop fs-ls /: view the root directory file
Hadoop fs-ls / tmp/data: view the / tmp/data directory
Hadoop fs-cat / tmp/a.txt: view a.txt, same as-text
Hadoop fs-mkdir dir: create directory dir
Hadoop fs-get / aaa/jdk.tar.gz: equivalent to copyToLocal, which downloads files from hdfs to local
Hadoop fs-df-h /: statistics on the free space of the file system
Hadoop fs-cp / aaa/jdk.tar.gz / bbb/jdk.tar.gz.2: copy hdfs from one path of hdfs to another path
Hadoop fs-mv / aaa/jdk.tar.gz /: move files in the hdfs directory
Hadoop fs-du-s-h / aaa/*: size information of statistical folders
Hadoop fs-rm-r / aaa/bbb/: delete files or folders
Hadoop fs-rmdir / aaa/bbb/ccc: delete a directory
Hadoop fs-tail / weblog/access_log.1: displays the end of a file
3. Administrative command # command helps [hadoop@hadoop000 ~] $hdfs dfsadminUsage: hdfs dfsadminNote: Administrative commands can only be run as the HDFS superuser. [- report [- live] [- dead] [- decommissioning]] [- safemode] [- saveNamespace] [- rollEdits] [- restoreFailedStorage true | false | check] [- refreshNodes] [- setQuota.] [- clrQuota.] [- setSpaceQuota [- storageType].] [- clrSpaceQuota [- storageType].] [ -finalizeUpgrade] [- rollingUpgrade []] [- refreshServiceAcl] [- refreshUserToGroupsMappings] [- refreshSuperUserGroupsConfiguration] [- refreshCallQueue] [- refresh [arg1..argn] [- reconfig] [- printTopology] [- refreshNamenodes datanode_host:ipc_port] [- deleteBlockPool datanode_host:ipc_port blockpoolId [force]] [- setBalancerBandwidth] [- getBalancerBandwidth] [- fetchImage] [- allowSnapshot] [- disallowSnapshot] [- shutdownDatanode [upgrade]] [- evictWriters] [- getDatanodeInfo] [- metasave filename] [- triggerBlockReport [- incremental]] [- help [cmd]]
Hdfs dfsadmin-report: show all dataNode
Hdfs dfsadmin-safemode leave: leave safe mode
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.