1. see hdfs Files under the root directory
hdfs dfs -ls /
2. see hdfs All file structures in a directory :
as : View all file structures in the root directory
hdfs dfs -ls -R / hdfs dfs -lsr /
as : View root file tmp List of all files under
hdfs dfs -ls -R /tmp/ hdfs dfs -lsr /tmp/
3. create folder
as : In the root file test Directory , establish test2
hdfs dfs -mkdir /test/test2
perhaps :
hdfs dfs -mkdir hdfs://
4. create folder - Create folder recursively
hdfs dfs -mkdir -p /test/test3/test4/
5. Local file mobile upload hdfs A directory :
as :
hdfs dfs -moveFromLocal /opt/hadoop/servers/test/hellow.txt /test/test123
6.hdfs Move files to local :
as :
hdfs dfs -moveToLocal /test/test123/hellow.txt /opt/hadoop/servers/
There's a problem :
moveToLocal: Option ‘-moveToLocal’ is not implemented yet

7.hdfs Move files internally
hdfs dfs -mv /test/test123/ /test/test2/
8. Place local files in hdfs A directory :
hdfs dfs -put /opt/hadoop/servers/test/ /tmp/
9. see hdfs The contents of a file on the :
hdfs dfs -cat /test/test2/test123/hellow.txt
10. Append one or more files to hdfs In the specified file . You can also read input from the command line
as : Append local aa.txt reach hdfs Upper hellow.txt in
hdfs dfs -appendToFile /opt/hadoop/servers/test/aa.txt
as : Append local bb.txt cc.txt reach hdfs Upper hellow.txt in :
hdfs dfs -appendToFile /opt/hadoop/servers/test/dd.txt
/opt/hadoop/servers/test/cc.txt /test/test2/test123/hellow.txt
11.hdfs Inter file copy : Copy file ( Clip ), Can cover , The original permission information can be retained
hdfs dfs -cp /test/test2/test123/hellow.txt /test/
12.hdfs Delete a file
hdfs dfs -rm /test/test2/test123/hellow.txt
13.hfds Recursive deletion
hdfs dfs -rm -r /test
14.hdfs Give folder permissions
hdfs dfs -chmod -R -777 /
* get format hdfs dfs -get [-ignorecrc ] [-crc] <src> <localdst> effect : Copy files to local file system .
CRC The file that failed the verification passed -ignorecrc Option copy . Documents and CRC The checksum can be passed -CRC Option copy hdfs dfs -get /install.log
* chown format : hdfs dfs -chmod [-R] URI[URI ...] effect : Change the user and user group to which the file belongs . If used -R
option , Valid recursive execution for the entire directory . The user using this command must be the user of the file , Or super user . hdfs dfs -chown -R hadoop:hadoop
In summary …

©2019-2020 Toolsou All rights reserved,
java Comparing attribute values between two objects utilize Python handle Excel data ——xlrd,xlwt library Bidirectional linked list Why? Python Not a future oriented programming language ?Python【 Assignment statement 】 Special lecture , You can't just a=b ah ! Suggest mastering ! utilize Python handle Excel data ——pandas library see SQL-SERVER Data volume and occupied space of database and each table PID The algorithm finally figured out the principle , It was so simple web Two front-end practical games ( Attached source code ) Beginners learn Python Be sure to know what his basic algorithms are ? What is the function ?