How to create a directory in HDFS?

Hi, I try to create a directory in HDFS and with the command of ‘hadoop fs -mkdir /home/bintaoli6311’ and get the following message. How can I obtain the permission? thanks.

Regards,
Bintao Li

"
mkdir: Permission denied: user=bintaoli6311, access=WRITE, inode="/home/bintaoli6311":hdfs:hdfs:drwxr-xr-x "

Hi Bintao,

you can use the below path to create a file or dir in HDFS

hdfs path: /user/bintaoli6311/

Try below command and see

hadoop fs -mkdir /user/bintaoli6311/dir_or_file_name/

hope it helps you :slight_smile:

Thanks,
Shanmukh

3 Likes