Hadoop FS Chmod

Share

                          Hadoop FS Chmod

In Hadoop HDFS (Hadoop Distributed File System), you can use the hadoop fs -chmod command to change the permissions of files and directories, similar to the chmod command in Unix-like file systems. This command allows you to control who can read, write, and execute files in HDFS. Here’s the basic syntax for using hadoop fs -chmod:

bash
hadoop fs -chmod <permissions> <path>
  • <permissions>: A three-digit octal number that represents the new permissions you want to set for the file or directory. Each digit corresponds to read (4), write (2), and execute (1) permissions for the owner, group, and others. For example, 755 means read, write, and execute for the owner and read and execute for the group and others.
  • <path>: The path to the file or directory in HDFS whose permissions you want to change.

Here are some examples of how to use hadoop fs -chmod:

  1. To give read and execute permissions to the owner and read-only permissions to the group and others for a file named “datafile.txt” in HDFS:
bash
hadoop fs -chmod 744 /user/hadoop/datafile.txt
  1. To make a directory named “mydir” in HDFS writable by the owner and read-only for others:
bash
hadoop fs -chmod 711 /user/hadoop/mydir
  1. To remove all permissions for the group and others on a directory named “logs”:
bash
hadoop fs -chmod 700 /user/hadoop/logs
  1. To give read and execute permissions to the owner and group and no permissions to others for all files in a directory:
bash
hadoop fs -chmod -R 550 /user/hadoop/mydirectory

The -R option is used for recursive permission changes, applying the specified permissions to all files and subdirectories within the given directory.

Hadoop Training Demo Day 1 Video:

 
You can find more information about Hadoop Training in this Hadoop Docs Link

 

Conclusion:

Unogeeks is the No.1 IT Training Institute for Hadoop Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on Hadoop Training here – Hadoop Blogs

Please check out our Best In Class Hadoop Training Details here – Hadoop Training

💬 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *