hdfs dfs Use command , Path use /project/test/ replace

<> for example

Query the sample data of the first few lines :
hdfs dfs -cat /project/test/test.txt | head -17

After query 5 Row data :
hdfs dfs -cat /project/test/test.txt | tail -5

Returns a sample of a specified number of rows at random :
hdfs dfs -cat /project/test/test.txt | shuf -n 5

View the number of lines of text :
hdfs dfs -cat /project/test/test.txt | wc -l

Query the contents of the file after the fifth line :
hdfs dfs -cat /project/test/test.txt | tail -n +5

Query filter field num:
hdfs dfs -cat /project/test/test.txt | grep num

View file size :
hdfs dfs -du /project/test/test.txt
hdfs dfs -du /project/test/*

Displays the number of files under the folder :
hdfs dfs -count /project/test/

Create directory dir1 and dir2:
hdfs dfs -mkdir -p /project/test/dir1 /project/test/dir2

Show folder test Directory under :
hdfs dfs -ls /project/test/
Recursive display test Directory under :
hdfs dfs -ls -R /project/test/ or hdfs dfs -lsr /project/test/

Upload local files to hdfs Target path :
hdfs dfs -put /home/bb/test1.txt /project/test/

Copy files from destination path to local :
hdfs dfs -get /project/test/test1 /home/bb/

Copy the file or directory to the destination path :
hdfs dfs -cp from path Target path

Delete file or directory :
hdfs dfs -rm route
Delete the folder and its contents :
hdfs dfs -rm -r route
Skip trash can deletion :
hdfs dfs -rm -r -skipTrash route

Display as text to standard output :
hdfs dfs -text /project/test/

Displays the last of the file 1KB To standard output :
hdfs dfs -tail -f /project/test/t.txt

©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 ?