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
:
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
:
- 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:
hadoop fs -chmod 744 /user/hadoop/datafile.txt
- To make a directory named “mydir” in HDFS writable by the owner and read-only for others:
hadoop fs -chmod 711 /user/hadoop/mydir
- To remove all permissions for the group and others on a directory named “logs”:
hadoop fs -chmod 700 /user/hadoop/logs
- To give read and execute permissions to the owner and group and no permissions to others for all files in a directory:
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:
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