Skip to content

Instantly share code, notes, and snippets.

@kawamon
Last active June 12, 2020 07:44
Show Gist options
  • Save kawamon/93e48232affe86523b3aec23bfa0dc3a to your computer and use it in GitHub Desktop.
Save kawamon/93e48232affe86523b3aec23bfa0dc3a to your computer and use it in GitHub Desktop.
HDFS FSshell commands log
********************
test start
********************
mkdir/rmdir
********************
hdfs dfs -mkdir /tmp/testdir
hdfs dfs -mkdir -p /tmp/subdir1/subdir2/subdir3
hdfs dfs -mkdir testdirhome
hdfs dfs -ls /tmp
Found 7 items
d--------- - hdfs supergroup 0 2020-06-12 00:38 /tmp/.cloudera_health_monitoring_canary_files
-rw-r--r-- 3 training supergroup 10 2020-06-11 23:04 /tmp/access.log
drwx-wx-wx - hive supergroup 0 2020-04-21 19:49 /tmp/hive
drwxrwxrwt - mapred hadoop 0 2020-04-21 19:49 /tmp/logs
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1
drwxr-xr-x+ - training supergroup 0 2020-06-12 00:30 /tmp/subdirA
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/testdir
hdfs dfs -ls -R /tmp/subdir1
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2/subdir3
hdfs dfs -ls
Found 3 items
drwx------ - training supergroup 0 2020-06-11 23:06 .Trash
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 contents
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 testdirhome
hdfs dfs -rmdir /tmp/testdir
hdfs dfs -rmdir testdirhome
hdfs dfs -rmdir /tmp/subdir1
rmdir: `/tmp/subdir1': Directory is not empty
********************
ls/find/cat/head/tail/text
********************
hdfs dfs -ls /tmp
Found 6 items
d--------- - hdfs supergroup 0 2020-06-12 00:39 /tmp/.cloudera_health_monitoring_canary_files
-rw-r--r-- 3 training supergroup 10 2020-06-11 23:04 /tmp/access.log
drwx-wx-wx - hive supergroup 0 2020-04-21 19:49 /tmp/hive
drwxrwxrwt - mapred hadoop 0 2020-04-21 19:49 /tmp/logs
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1
drwxr-xr-x+ - training supergroup 0 2020-06-12 00:30 /tmp/subdirA
hdfs dfs -ls -R /tmp/subdir1
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2/subdir3
hdfs dfs -find -name "*.txt" -print
contents/BTESTB.txt
contents/TESTA.txt
contents/TESTB.txt
contents/TSTC.txt
contents/a.txt
contents/aget.txt
contents/atesta.txt
contents/b.txt
contents/c.txt
contents/d.txt
contents/localmerge.txt
contents/testa.txt
contents/testb.txt
contents/tstc.txt
hdfs dfs -find -iname "*TEST*" -print
contents/BTESTB.txt
contents/TESTA.txt
contents/TESTB.txt
contents/atesta.txt
contents/test.zip
contents/testa.txt
contents/testb.txt
hdfs dfs -cat contents/a.txt
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
0000000000
hdfs dfs -head contents/access.log
10.34.198.119 - - [31/May/2013:00:00:00 -0800] "GET /about/careers HTTP/1.1" 200 48091 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=743021225616"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /contact HTTP/1.1" 500 176 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /css/style.css HTTP/1.1" 304 0 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /img/beacon.png HTTP/1.1" 304 0 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /img/dualcore-logo.png HTTP/1.1" 200 5692 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0;
hdfs dfs -tail contents/access.log
06 -0800] "GET /cart/additem?productid=1274298 HTTP/1.1" 200 45177 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=604651245531"
192.168.29.7 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274301 HTTP/1.1" 200 28733 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=958248217874"
192.168.39.20 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274304 HTTP/1.1" 200 39028 "http://www.google.com/search?q=electronics" "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3" "SESSIONID=936341110723"
10.69.1.240 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274336 HTTP/1.1" 200 54045 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=186637936475"
hdfs dfs -text contents/access.log
10.34.198.119 - - [31/May/2013:00:00:00 -0800] "GET /about/careers HTTP/1.1" 200 48091 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=743021225616"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /contact HTTP/1.1" 500 176 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /css/style.css HTTP/1.1" 304 0 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /img/beacon.png HTTP/1.1" 304 0 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /img/dualcore-logo.png HTTP/1.1" 200 5692 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
192.168.250.171 - - [31/May/2013:00:00:02 -0800] "GET /img/shim.png HTTP/1.1" 304 0 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=909881341477"
10.214.169.217 - - [31/May/2013:00:00:04 -0800] "GET / HTTP/1.1" 200 25653 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=140730946432"
10.214.169.217 - - [31/May/2013:00:00:04 -0800] "GET /css/style.css HTTP/1.1" 304 0 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=140730946432"
10.214.169.217 - - [31/May/2013:00:00:04 -0800] "GET /img/beacon.png HTTP/1.1" 304 0 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=140730946432"
10.214.169.217 - - [31/May/2013:00:00:04 -0800] "GET /img/dualcore-logo.png HTTP/1.1" 304 0 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=140730946432"
10.214.169.217 - - [31/May/2013:00:00:04 -0800] "GET /img/shim.png HTTP/1.1" 304 0 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=140730946432"
10.188.173.8 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273658 HTTP/1.1" 200 12550 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=918203179298"
10.26.40.24 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273667 HTTP/1.1" 500 176 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=656769350354"
192.168.164.92 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273689 HTTP/1.1" 200 46686 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, like Gecko) Version/5.1.8 Safari/534.58.2" "SESSIONID=549886377867"
172.19.156.239 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273732 HTTP/1.1" 200 59659 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=508114930333"
192.168.217.122 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273744 HTTP/1.1" 200 49314 "http://www.example.com/about/careers" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10" "SESSIONID=359753135814"
172.16.71.29 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273749 HTTP/1.1" 200 42667 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=778644110980"
10.143.94.162 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273760 HTTP/1.1" 200 48365 "http://www.google.com/search?q=electronics" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=446707306702"
192.168.110.38 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273772 HTTP/1.1" 200 34398 "http://www.example.com/clearancesale" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=964023310535"
10.84.128.30 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273772 HTTP/1.1" 200 44768 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0" "SESSIONID=282565352903"
192.168.68.61 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273776 HTTP/1.1" 500 176 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=888792446309"
10.49.19.140 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273798 HTTP/1.1" 200 41247 "http://www.example.com/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=198836373467"
10.176.11.17 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273799 HTTP/1.1" 200 20013 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (iPad; CPU OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25" "SESSIONID=833335140998"
10.154.159.208 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273814 HTTP/1.1" 200 37154 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (iPad; CPU OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" "SESSIONID=941401208518"
10.148.123.82 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273842 HTTP/1.1" 200 35285 "http://www.example.com/contact" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=477892731075"
10.44.174.167 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273842 HTTP/1.1" 200 37770 "http://www.example.com/weekly-sales" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, like Gecko) Version/5.1.8 Safari/534.58.2" "SESSIONID=101764230285"
192.168.51.55 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273863 HTTP/1.1" 200 10143 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=434355205076"
192.168.57.48 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273887 HTTP/1.1" 200 43269 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10" "SESSIONID=563144323213"
10.132.248.147 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273905 HTTP/1.1" 200 18688 "http://www.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=492115185775"
172.18.169.65 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273905 HTTP/1.1" 200 30668 "http://www.google.com/search?q=storage" "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=373557332138"
192.168.238.34 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273916 HTTP/1.1" 200 48528 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=777398527301"
10.80.122.242 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273931 HTTP/1.1" 200 43642 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=108258021172"
192.168.218.57 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273932 HTTP/1.1" 200 34281 "http://www.google.com/search?q=scanners" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=411061584646"
172.18.110.185 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273935 HTTP/1.1" 200 23725 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22" "SESSIONID=912589129849"
172.19.238.54 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273940 HTTP/1.1" 200 23408 "http://www.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=843637264409"
172.18.19.175 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273942 HTTP/1.1" 200 7955 "http://www.google.com/search?q=scanners" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=795241155747"
192.168.44.91 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273946 HTTP/1.1" 200 57212 "http://www.example.com/about/careers" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1" "SESSIONID=509099194450"
172.17.166.91 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273956 HTTP/1.1" 200 30835 "http://www.google.com/search?q=storage" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=355927226870"
192.168.96.85 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273956 HTTP/1.1" 200 8625 "http://www.example.com/about/careers" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=805746428983"
10.40.97.207 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1273991 HTTP/1.1" 500 176 "http://www.example.com/" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=507047316505"
172.18.17.34 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274012 HTTP/1.1" 200 51701 "http://www.example.com/weekly-sales" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22" "SESSIONID=478203257909"
192.168.126.237 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274019 HTTP/1.1" 200 57104 "http://www.example.com/adlanding?productid=1274348" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=897370705577"
10.119.208.64 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274021 HTTP/1.1" 200 36847 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22" "SESSIONID=600886149080"
192.168.50.137 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274021 HTTP/1.1" 200 49856 "http://www.example.com/contact" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=398301188468"
10.26.40.24 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274021 HTTP/1.1" 500 176 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=656769350354"
172.16.87.243 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274024 HTTP/1.1" 200 52369 "http://www.example.com/weekly-sales" "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0" "SESSIONID=237597401097"
10.100.147.124 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274034 HTTP/1.1" 200 18354 "http://www.google.com/search?q=storage" "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3" "SESSIONID=966877368385"
192.168.241.18 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274038 HTTP/1.1" 200 24189 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=723925298654"
172.19.234.49 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274047 HTTP/1.1" 200 11662 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=430756138243"
10.43.60.10 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274047 HTTP/1.1" 200 22792 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1" "SESSIONID=256537322812"
192.168.175.107 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274053 HTTP/1.1" 200 37819 "http://www.google.com/search?q=storage" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=207373356976"
10.210.229.1 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274054 HTTP/1.1" 200 26950 "http://www.google.com/search?q=scanners" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2" "SESSIONID=926773328098"
192.168.131.56 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274055 HTTP/1.1" 200 56121 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=192059836792"
172.16.22.15 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274057 HTTP/1.1" 200 29976 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1" "SESSIONID=382418163676"
172.18.74.127 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274059 HTTP/1.1" 200 42973 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=515263374585"
172.18.114.173 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274070 HTTP/1.1" 200 4011 "http://www.example.com/adlanding?productid=1274348" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=108325021054"
192.168.244.85 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274078 HTTP/1.1" 200 27134 "http://www.google.com/search?q=storage" "Mozilla/5.0 (iPad; CPU OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25" "SESSIONID=103724334876"
192.168.28.63 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274082 HTTP/1.1" 200 9991 "http://www.example.com/contact" "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3" "SESSIONID=647910955498"
10.83.76.94 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274085 HTTP/1.1" 200 33546 "http://www.example.com/about/careers" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=368583254259"
172.16.60.86 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274085 HTTP/1.1" 200 5291 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=123256772768"
10.235.117.110 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274091 HTTP/1.1" 200 21316 "http://www.example.com/clearancesale" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=738122845674"
192.168.119.153 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274111 HTTP/1.1" 200 30453 "http://www.example.com/contact" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=801368209157"
192.168.147.216 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274111 HTTP/1.1" 200 32469 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=263158150870"
192.168.20.138 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274124 HTTP/1.1" 200 20478 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=867631163559"
192.168.224.187 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274125 HTTP/1.1" 200 19320 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, like Gecko) Version/5.1.8 Safari/534.58.2" "SESSIONID=203916334160"
10.243.72.224 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274126 HTTP/1.1" 200 4948 "http://www.google.com/search?q=jobs" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=785875961054"
172.18.195.32 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274143 HTTP/1.1" 200 46412 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=814896358645"
172.16.6.45 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274144 HTTP/1.1" 200 30207 "http://www.example.com/adlanding?productid=1274348" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22" "SESSIONID=107843345553"
192.168.166.17 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274145 HTTP/1.1" 200 10458 "http://www.google.com/search?q=notebook" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=910178172554"
172.16.169.26 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274147 HTTP/1.1" 200 8463 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=528421304425"
192.168.65.82 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274154 HTTP/1.1" 200 58778 "http://www.google.com/search?q=computers" "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" "SESSIONID=100239913205"
10.209.173.81 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274157 HTTP/1.1" 200 18952 "http://www.example.com/weekly-sales" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22" "SESSIONID=730402309779"
192.168.128.197 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274163 HTTP/1.1" 200 44430 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0" "SESSIONID=669565425607"
192.168.146.159 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274164 HTTP/1.1" 200 45939 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=223422353001"
192.168.211.41 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274171 HTTP/1.1" 200 17525 "http://www.google.com/search?q=computers" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=933024121805"
10.212.183.29 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274173 HTTP/1.1" 200 54368 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=109143434224"
192.168.80.37 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274173 HTTP/1.1" 200 55899 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=693122152015"
192.168.139.2 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274175 HTTP/1.1" 200 43591 "http://www.example.com/index.html" "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3" "SESSIONID=547879238472"
10.158.178.238 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274178 HTTP/1.1" 200 25559 "http://www.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=254297966580"
172.18.33.9 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274178 HTTP/1.1" 200 33663 "http://www.example.com/clearancesale" "Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=354782216622"
172.17.4.212 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274179 HTTP/1.1" 200 25048 "http://www.example.com/search?phrase=TERM" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=104737419024"
172.16.79.137 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274180 HTTP/1.1" 200 12141 "http://www.google.com/search?q=computers" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1" "SESSIONID=319067365793"
172.16.14.53 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274186 HTTP/1.1" 200 6928 "http://www.google.com/search?q=TV" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=102141328888"
192.168.185.99 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274200 HTTP/1.1" 200 44822 "http://www.example.com/weekly-sales" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=161122170011"
10.186.236.156 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274217 HTTP/1.1" 200 47717 "http://www.example.com/index.html" "Mozilla/5.0 (iPad; CPU OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25" "SESSIONID=407791221605"
172.16.110.16 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274225 HTTP/1.1" 500 176 "http://www.example.com/about/careers" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=485211174155"
172.16.239.172 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274236 HTTP/1.1" 200 14705 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=574530189318"
192.168.172.238 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274246 HTTP/1.1" 200 15825 "http://www.example.com/adlanding?productid=1274348" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=347302114642"
172.19.135.50 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274258 HTTP/1.1" 200 14784 "http://www.example.com/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=633686228123"
10.139.115.172 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274263 HTTP/1.1" 200 15882 "http://www.example.com/about/careers" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=463608327086"
10.130.21.149 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274263 HTTP/1.1" 200 40080 "http://www.example.com/about/careers" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" "SESSIONID=996958492086"
192.168.17.117 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274265 HTTP/1.1" 200 45750 "http://www.google.com/search?q=tablet" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=102208456969"
192.168.200.117 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274276 HTTP/1.1" 200 26184 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22" "SESSIONID=713115322457"
10.239.172.70 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274285 HTTP/1.1" 200 33654 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10" "SESSIONID=576422168557"
10.38.22.21 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274285 HTTP/1.1" 200 54967 "http://www.google.com/search?q=laptop" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=296366190482"
192.168.33.111 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274293 HTTP/1.1" 200 17004 "http://www.google.com/search?q=TV" "Mozilla/5.0 (iPad; CPU OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25" "SESSIONID=441331355769"
10.91.61.139 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274298 HTTP/1.1" 200 45177 "http://www.example.com/" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=604651245531"
192.168.29.7 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274301 HTTP/1.1" 200 28733 "http://www.google.com/search?q=DVD" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17" "SESSIONID=958248217874"
192.168.39.20 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274304 HTTP/1.1" 200 39028 "http://www.google.com/search?q=electronics" "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3" "SESSIONID=936341110723"
10.69.1.240 - - [31/May/2013:00:00:06 -0800] "GET /cart/additem?productid=1274336 HTTP/1.1" 200 54045 "http://www.google.com/search?q=TV" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0" "SESSIONID=186637936475"
********************
put/copyFromLocal/moveFromLocal
********************
hdfs dfs -put a.txt /tmp
hdfs dfs -copyFromLocal a.txt /tmp/a1.txt
hdfs dfs -moveFromLocal d.txt /tmp/
hdfs dfs -ls /tmp/*.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/a.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/a1.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/d.txt
ls *.txt
atesta.txt BTESTB.txt c.txt TESTA.txt TESTB.txt TSTC.txt
a.txt b.txt testa.txt testb.txt tstc.txt
********************
get/copyToLocal/moveToLocal
********************
hdfs dfs -get /tmp/a.txt aget.txt
hdfs dfs -copyToLocal /tmp/d.txt d.txt
hdfs dfs -moveToLocal /tmp/d.txt x.txt
moveToLocal: Option '-moveToLocal' is not implemented yet.
ls *.txt
aget.txt a.txt b.txt d.txt TESTA.txt TESTB.txt TSTC.txt
atesta.txt BTESTB.txt c.txt testa.txt testb.txt tstc.txt
********************
getmerge
********************
hdfs dfs -getmerge contents/a.txt contents/b.txt contents/c.txt localmerge.txt
cat localmerge.txt
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
0000000000
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
0000000000
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
0000000000
********************
cp/mv/rm
********************
hdfs dfs -cp /tmp/a.txt /tmp/acp.txt
hdfs dfs -cp /tmp/b.txt c.txt /tmp/subdir1/
hdfs dfs -cp contents/access.log /tmp/subdir1
hdfs dfs -ls /tmp/subdir1
Found 4 items
-rw-r--r-- 3 training supergroup 26882 2020-06-12 00:40 /tmp/subdir1/access.log
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/subdir1/b.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/subdir1/c.txt
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2
hdfs dfs -ls /tmp/
Found 10 items
d--------- - hdfs supergroup 0 2020-06-12 00:39 /tmp/.cloudera_health_monitoring_canary_files
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/a.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/a1.txt
-rw-r--r-- 3 training supergroup 10 2020-06-11 23:04 /tmp/access.log
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/acp.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/d.txt
drwx-wx-wx - hive supergroup 0 2020-04-21 19:49 /tmp/hive
drwxrwxrwt - mapred hadoop 0 2020-04-21 19:49 /tmp/logs
drwxr-xr-x - training supergroup 0 2020-06-12 00:40 /tmp/subdir1
drwxr-xr-x+ - training supergroup 0 2020-06-12 00:30 /tmp/subdirA
hdfs dfs -mv /tmp/a.txt /tmp/subdir1/
hdfs dfs -mv /tmp/b.txt /tmp/subdir1/bren.txt
mv: `/tmp/b.txt': No such file or directory
hdfs dfs -ls /tmp/subdir1
Found 5 items
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:39 /tmp/subdir1/a.txt
-rw-r--r-- 3 training supergroup 26882 2020-06-12 00:40 /tmp/subdir1/access.log
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/subdir1/b.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/subdir1/c.txt
drwxr-xr-x - training supergroup 0 2020-06-12 00:39 /tmp/subdir1/subdir2
hdfs dfs -rm -skipTrash /tmp/acp.txt
Deleted /tmp/acp.txt
hdfs dfs -ls /tmp/acp.txt
ls: `/tmp/acp.txt': No such file or directory
hdfs dfs -rm -R -skipTrash /tmp/subdir1
Deleted /tmp/subdir1
hdfs dfs -ls /tmp/subdir1
ls: `/tmp/subdir1': No such file or directory
********************
ouchz/truncat/appendToFile
********************
hdfs dfs -touchz /tmp/zero.txt
hdfs dfs -ls /tmp/zero.txt
-rw-r--r-- 3 training supergroup 0 2020-06-12 00:40 /tmp/zero.txt
hdfs dfs -truncate 10 /tmp/access.log
truncate: Failed to TRUNCATE_FILE /tmp/access.log for DFSClient_NONMAPREDUCE_913307903_1 on 127.0.0.1 because lease recovery is in progress. Try again later.
hdfs dfs -appendToFile /tmp/access.log contents/a.txt
20/06/12 00:40:47 WARN hdfs.DataStreamer: DataStreamer Exception
java.io.IOException: Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being available to try. (Nodes: current=[DatanodeInfoWithStorage[127.0.0.1:9866,DS-c48d0c81-feeb-4d87-8787-938ed0ecb26a,DISK]], original=[DatanodeInfoWithStorage[127.0.0.1:9866,DS-c48d0c81-feeb-4d87-8787-938ed0ecb26a,DISK]]). The current failed datanode replacement policy is DEFAULT, and a client may configure this via 'dfs.client.block.write.replace-datanode-on-failure.policy' in its configuration.
at org.apache.hadoop.hdfs.DataStreamer.findNewDatanode(DataStreamer.java:1304)
at org.apache.hadoop.hdfs.DataStreamer.addDatanode2ExistingPipeline(DataStreamer.java:1372)
at org.apache.hadoop.hdfs.DataStreamer.handleDatanodeReplacement(DataStreamer.java:1598)
at org.apache.hadoop.hdfs.DataStreamer.setupPipelineInternal(DataStreamer.java:1499)
at org.apache.hadoop.hdfs.DataStreamer.setupPipelineForAppendOrRecovery(DataStreamer.java:1481)
at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:720)
appendToFile: /home/training/private/hdfs_commands/contents/contents/a.txt (No such file or directory)
hdfs dfs -cat /tmp/access.log
10.34.198.cat /etc/hosts | hdfs dfs -appendToFile -
appendToFile: Failed to APPEND_FILE /tmp/access.log for DFSClient_NONMAPREDUCE_449634671_1 on 127.0.0.1 because this file lease is currently owned by DFSClient_NONMAPREDUCE_2041530887_1 on 127.0.0.1
hdfs dfs -cat /tmp/access.log
10.34.198.********************
count/df/du/dus/stat/test
********************
hdfs dfs -cp contents/*.txt /tmp
cp: `/tmp/d.txt': File exists
hdfs dfs -count /tmp
49 48 270288873 /tmp
hdfs dfs -count /tmp/access.log
0 1 10 /tmp/access.log
hdfs dfs -count -v -h /tmp
DIR_COUNT FILE_COUNT CONTENT_SIZE PATHNAME
49 48 257.8 M /tmp
hdfs dfs -df /tmp
Filesystem Size Used Available Use%
hdfs://localhost.localdomain:8020 81622174925 2606286775 45439496192 3%
hdfs dfs -df -h /tmp
Filesystem Size Used Available Use%
hdfs://localhost.localdomain:8020 76.0 G 2.4 G 42.3 G 3%
hdfs dfs -du /tmp
0 0 /tmp/.cloudera_health_monitoring_canary_files
110 330 /tmp/BTESTB.txt
110 330 /tmp/TESTA.txt
110 330 /tmp/TESTB.txt
110 330 /tmp/TSTC.txt
110 330 /tmp/a.txt
110 330 /tmp/a1.txt
10 402653184 /tmp/access.log
110 330 /tmp/aget.txt
110 330 /tmp/atesta.txt
110 330 /tmp/b.txt
110 330 /tmp/c.txt
110 330 /tmp/d.txt
269708326 809124978 /tmp/hive
330 990 /tmp/localmerge.txt
549490 1648470 /tmp/logs
29177 87531 /tmp/subdirA
110 330 /tmp/testa.txt
110 330 /tmp/testb.txt
110 330 /tmp/tstc.txt
0 0 /tmp/zero.txt
hdfs dfs -du -h -s /tmp
257.8 M 1.1 G /tmp
hdfs dfs -stat /tmp/access.log
2020-06-12 07:40:46
hdfs dfs -stat "type:%F size:%b name:%n" /tmp/access.log
type:regular file size:10 name:access.log
hdfs dfs -test -e /tmp/access.log
0
hdfs dfs -test -e /tmp/A.TXT
1
********************
checksum/chown/chgrp/touch
********************
hdfs dfs -cp contents/*.txt /tmp
cp: `/tmp/BTESTB.txt': File exists
cp: `/tmp/TESTA.txt': File exists
cp: `/tmp/TESTB.txt': File exists
cp: `/tmp/TSTC.txt': File exists
cp: `/tmp/a.txt': File exists
cp: `/tmp/aget.txt': File exists
cp: `/tmp/atesta.txt': File exists
cp: `/tmp/b.txt': File exists
cp: `/tmp/c.txt': File exists
cp: `/tmp/d.txt': File exists
cp: `/tmp/localmerge.txt': File exists
cp: `/tmp/testa.txt': File exists
cp: `/tmp/testb.txt': File exists
cp: `/tmp/tstc.txt': File exists
hdfs dfs -checksum /tmp/a.txt
/tmp/a.txt MD5-of-0MD5-of-512CRC32C 00000200000000000000000048774ac2c33d72e14d692c00e7bfc722
hdfs dfs -ls /tmp/a.txt /tmp/b.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/a.txt
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:40 /tmp/b.txt
sudo -u hdfs hdfs dfs -chown hdfs /tmp/a.txt
sudo -u hdfs hdfs dfs -chown testuser:testgrp /tmp/a.txt
sudo -u hdfs hdfs dfs -chgrp testgrp /tmp/b.txt
hdfs dfs -ls /tmp/a.txt /tmp/b.txt
-rw-r--r-- 3 testuser testgrp 110 2020-06-12 00:40 /tmp/a.txt
-rw-r--r-- 3 training testgrp 110 2020-06-12 00:40 /tmp/b.txt
sudo -u hdfs hdfs dfs -chmod 666 /tmp/a.txt
-rw-rw-rw- 3 testuser testgrp 110 2020-06-12 00:40 /tmp/a.txt
hdfs dfs -touch /tmp/z.txt
hdfs dfs -ls /tmp/z.txt
-rw-r--r-- 3 training supergroup 0 2020-06-12 00:41 /tmp/z.txt
hdfs dfs -ls /tmp/a.txt
-rw-rw-rw- 3 testuser testgrp 110 2020-06-12 00:40 /tmp/a.txt
hdfs dfs -touch -m -t 20200505:230000 /tmp/a.txt
hdfs dfs -ls /tmp/a.txt
-rw-rw-rw- 3 testuser testgrp 110 2020-05-05 23:00 /tmp/a.txt
********************
expunge/setrep
********************
hdfs dfs -cp /tmp/a.txt /tmp/aa.txt
hdfs dfs -cp /tmp/a.txt /tmp/bb.txt
hdfs dfs -rm /tmp/aa.txt
20/06/12 00:42:11 INFO fs.TrashPolicyDefault: Moved: 'hdfs://localhost.localdomain:8020/tmp/aa.txt' to trash at: hdfs://localhost.localdomain:8020/user/training/.Trash/Current/tmp/aa.txt
hdfs dfs -ls -R .Trash/
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/Current
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/Current/tmp
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:42 .Trash/Current/tmp/aa.txt
hdfs dfs -expunge
20/06/12 00:42:16 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:16 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:16 INFO fs.TrashPolicyDefault: TrashPolicyDefault#createCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:16 INFO fs.TrashPolicyDefault: Created trash checkpoint: /user/training/.Trash/200612004216
hdfs dfs -ls -R .Trash/
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216/tmp
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:42 .Trash/200612004216/tmp/aa.txt
hdfs dfs -expunge
20/06/12 00:42:21 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:21 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:22 INFO fs.TrashPolicyDefault: TrashPolicyDefault#createCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
hdfs dfs -ls -R .Trash/
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216/tmp
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:42 .Trash/200612004216/tmp/aa.txt
hdfs dfs -rm /tmp/bb.txt
20/06/12 00:42:27 INFO fs.TrashPolicyDefault: Moved: 'hdfs://localhost.localdomain:8020/tmp/bb.txt' to trash at: hdfs://localhost.localdomain:8020/user/training/.Trash/Current/tmp/bb.txt
hdfs dfs -ls -R .Trash/
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/200612004216/tmp
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:42 .Trash/200612004216/tmp/aa.txt
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/Current
drwx------ - training supergroup 0 2020-06-12 00:42 .Trash/Current/tmp
-rw-r--r-- 3 training supergroup 110 2020-06-12 00:42 .Trash/Current/tmp/bb.txt
hdfs dfs -expunge -immediate
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: TrashPolicyDefault#createCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: Created trash checkpoint: /user/training/.Trash/200612004232
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://localhost.localdomain:8020/user/training/.Trash
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: Deleted trash checkpoint: /user/training/.Trash/200612004216
20/06/12 00:42:32 INFO fs.TrashPolicyDefault: Deleted trash checkpoint: /user/training/.Trash/200612004232
hdfs dfs -ls -R .Trash/
hdfs dfs -ls /tmp/a.txt
-rw-rw-rw- 3 testuser testgrp 110 2020-05-05 23:00 /tmp/a.txt
hdfs dfs -setrep 5 /tmp/a.txt
Replication 5 set: /tmp/a.txt
hdfs dfs -ls /tmp/a.txt
-rw-rw-rw- 5 testuser testgrp 110 2020-05-05 23:00 /tmp/a.txt
********************
acl/attr
********************
cp: `/tmp/subdirA/BTESTB.txt': File exists
cp: `/tmp/subdirA/TESTA.txt': File exists
cp: `/tmp/subdirA/TESTB.txt': File exists
cp: `/tmp/subdirA/TSTC.txt': File exists
cp: `/tmp/subdirA/a.txt': File exists
cp: `/tmp/subdirA/access.log': File exists
cp: `/tmp/subdirA/aget.txt': File exists
cp: `/tmp/subdirA/atesta.txt': File exists
cp: `/tmp/subdirA/b.txt': File exists
cp: `/tmp/subdirA/c.txt': File exists
cp: `/tmp/subdirA/d.txt': File exists
cp: `/tmp/subdirA/localmerge.txt': File exists
cp: `/tmp/subdirA/test.zip': File exists
cp: `/tmp/subdirA/testa.txt': File exists
cp: `/tmp/subdirA/testb.txt': File exists
cp: `/tmp/subdirA/tstc.txt': File exists
sudo -u hdfs hdfs dfs -setfacl -m user:hadoop:rw- /tmp/a.txt
sudo -u hdfs hdfs dfs -setfacl -x user:hadoop /tmp/a.txt
sudo -u hdfs hdfs dfs -setfacl -b /tmp/a.txt
sudo -u hdfs hdfs dfs -setfacl -k /tmp/subdirA
sudo -u hdfs hdfs dfs -setfacl --set user::rw-,user:hadoop:rw-,group::r--,other::r-- /tmp/a.txt
sudo -u hdfs hdfs dfs -setfacl -R -m user:hadoop:r-x /tmp/subdirA
sudo -u hdfs hdfs dfs -setfacl -m default:user:hadoop:r-x /tmp/subdirA
hdfs dfs -getfacl /tmp/a.txt
# file: /tmp/a.txt
# owner: testuser
# group: testgrp
user::rw-
user:hadoop:rw-
group::r--
mask::rw-
other::r--
hdfs dfs -getfacl -R /tmp/subdirA
# file: /tmp/subdirA
# owner: training
# group: supergroup
user::rwx
user:hadoop:r-x
group::r-x
mask::r-x
other::r-x
default:user::rwx
default:user:hadoop:r-x
default:group::r-x
default:mask::r-x
default:other::r-x
# file: /tmp/subdirA/BTESTB.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/TESTA.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/TESTB.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/TSTC.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/a.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/access.log
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/aget.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/atesta.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/b.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/c.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/d.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/localmerge.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/subdirB
# owner: training
# group: supergroup
user::rwx
user:hadoop:r-x
group::r-x
mask::r-x
other::r-x
# file: /tmp/subdirA/subdirB/subdirC
# owner: training
# group: supergroup
user::rwx
user:hadoop:r-x
group::r-x
mask::r-x
other::r-x
# file: /tmp/subdirA/test.zip
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/testa.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/testb.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
# file: /tmp/subdirA/tstc.txt
# owner: training
# group: supergroup
user::rw-
user:hadoop:r-x
group::r--
mask::r-x
other::r--
sudo -u hdfs hdfs dfs -setfattr -n user.myAttr -v myValue /tmp/a.txt
sudo -u hdfs hdfs dfs -setfattr -n user.novalue /tmp/b.txt
hdfs dfs -getfattr -d /tmp/a.txt
# file: /tmp/a.txt
user.myAttr="myValue"
hdfs dfs -getfattr -d /tmp/b.txt
# file: /tmp/b.txt
user.novalue
sudo -u hdfs hdfs dfs -setfattr -x user.myAttr /tmp/a.txt
sudo -u hdfs hdfs dfs -setfattr -x user.novalue /tmp/b.txt
hdfs dfs -getfattr -d /tmp/a.txt
# file: /tmp/a.txt
hdfs dfs -getfattr -d /tmp/b.txt
# file: /tmp/b.txt
********************
usage/help
********************
hdfs dfs -usage cat
Usage: hadoop fs [generic options] -cat [-ignoreCrc] <src> ...
hdfs dfs -help cat
-cat [-ignoreCrc] <src> ... :
Fetch all files that match the file pattern <src> and display their content on
stdout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment