Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46463503
HBASE Shell
Enter HABSE database terminal: # $HBASE _home/bin/hbase Shell
Create a table
>create ' users ', ' user_id ', ' address ', ' info '
Table users, there are three column families User_id,address,info
List all Tables
>list
Get a description of the table
>describe ' Users
Create a table
>create ' users_tmp ', ' user_id ', ' address ', ' info '
Delete a table
>disable ' users_tmp '
>drop ' users_tmp '
Add a record
Put ' users ', ' xiaoming ', ' info:age ', ' 24 ';
Put ' users ', ' xiaoming ', ' info:birthday ', ' 1987-06-17 ';
Put ' users ', ' xiaoming ', ' info:company ', ' Alibaba ';
Put ' users ', ' xiaoming ', ' address:contry ', ' China ';
Put ' users ', ' xiaoming ', ' address:province ', ' Zhejiang ';
Put ' users ', ' xiaoming ', ' address:city ', ' Hangzhou ';
Put ' users ', ' Zhangyifei ', ' info:birthday ', ' 1987-4-17 ';
Put ' users ', ' Zhangyifei ', ' info:favorite ', ' movie ';
Put ' users ', ' Zhangyifei ', ' info:company ', ' Alibaba ';
Put ' users ', ' Zhangyifei ', ' address:contry ', ' China ';
Put ' users ', ' Zhangyifei ', ' address:province ', ' Guangdong ';
Put ' users ', ' Zhangyifei ', ' address:city ', ' Jieyang ';
Put ' users ', ' Zhangyifei ', ' address:town ', ' Xianqiao ';
Get a record 1. Get all data for an ID
>get ' users ', ' xiaoming '
2. Get an ID, all data for a column family
>get ' users ', ' xiaoming ', ' info '
3. Get an ID, all data for one column in a column family
Get ' users ', ' xiaoming ', ' info:age '
Update record
>put ' users ', ' xiaoming ', ' info:age ', ' 29 '
>get ' users ', ' xiaoming ', ' info:age '
>put ' users ', ' xiaoming ', ' info:age ', ' 30 '
>get ' users ', ' xiaoming ', ' info:age '
Get version data for cell data
>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>1}
>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>2}
>get ' users ', ' xiaoming ',{column=> ' info:age ', versions=>3}
Get a version of the cell data
〉get ' users ', ' xiaoming ',{column=> ' info:age ', timestamp=>1364874937056}
Full table Scan
>scan ' users '
Delete the ' info:age ' field of the Xiaoming value
>delete ' users ', ' xiaoming ', ' info:age '
>get ' users ', ' xiaoming '
Delete entire row
>deleteall ' users ', ' xiaoming '
Number of rows in the statistics table
>count ' users '
Clear table >truncate ' users '
Hadoop's--hbase shell command