persist permissions to all files in directory HDFS

12,201

Use "-R" (Recursive) option.

hadoop fs -chmod -R 755 /home/set1/data1/
Share:
12,201
lightweight
Author by

lightweight

Updated on June 14, 2022

Comments

  • lightweight
    lightweight almost 2 years

    I am trying to do a chmod 755 on all the directories and files in an HDFS directory but it wont persist all the way down.

    for example, if I have a directory like this:

    /home/set1/data1/file1.txt
    

    I need to do this so my app can access it:

    haddop fs -chmod 755 /home/set1/*
    haddop fs -chmod 755 /home/set1/data1/*
    haddop fs -chmod 755 /home/set1/data1/file*
    haddop fs -chmod 755 /home/set1/data2/*
    haddop fs -chmod 755 /home/set1/data2/file*
    haddop fs -chmod 755 /home/set1/data3/*
    haddop fs -chmod 755 /home/set1/data3/file*
    

    how do I get the permission to set for each directory and file in the path in HDFS?