Hadoop creates user and HDFS permissions, HDFS operations, and other common shell commands

Source: Internet
Author: User
Tags hadoop fs

Sudo addgroup hadoop # Add a hadoop Group
Sudo usermod-a-g hadoop Larry # Add the current user to the hadoop Group
Sudo gedit ETC/sudoers # Add the hadoop group to sudoer
Hadoop all = (all) All after root all = (all) All

Modify hadoop Directory Permissions
Sudo chown-r Larry: hadoop/home/Larry/hadoop <owner: group File>

Sudo chmod-r 755/home/Larry/hadoop

Modify HDFS Permissions
Sudo bin/hadoop DFS-chmod-r 755/
Sudo bin/hadoop DFS-ls/

Modify the HDFS file owner

Sudo bin/hadoop FS-chown-r Larry/

Sudo bin/hadoop dfsadmin-safemode leave # Remove hadoop Security Mode

Hadoop FS-copyfromlocal <localsrc> URI # copy a local file to HDFS

Hadoop FS-cat file: // file3/user/hadoop/file4 # output the content of the specified file in the path to stdout

Hadoop
FS-chgrp [-R] group URI # change the group to which the object belongs

Hadoop
FS-chmod [-R] 755 URI # Change User Access Permissions

Hadoop
FS-chown [-R] [owner] [: [group] URI [URI] # modify the object owner

Hadoop
FS-copytolocal URI localdst # copy the HDFS file to the local device

Hadoop
FS-cp uri [URI…] <DEST> # copy HDFS files to other directories

Hadoop
FS-du URI [URI…] # Display the size of all files in the directory

Hadoop
FS-getmerge <SRC> <localdst> [addnl] # Merge files to the local directory




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.