How to Give Unix User (owner) ALL Access (777) to ALL Files/Folders under a specifc Directory?

Posted on 2011-10-24
Medium Priority
Last Modified: 2012-05-12
I have a Unix folder (Peoplesoft) on AIX that I want to give the user (owner of the folder) ALL Access (777) to all files and folders "under this directory".

What is the CHMOD command to give my user "777" rights to all files and folders under a specific Unix directory?

I dont' want to have any issues with permissions with any of the files or folders under this dirctory.
Question by:matrix0511
  • 3
LVL 68

Expert Comment

ID: 37018111

although for security reasons I wouldn't recommend doing this, the command would be e.g.

chmod -R 777 PeopleSoft

Note: this would give execution permission to all files, which might not be what you desire.

Better try this:

find PeopleSoft -type d | xargs chmod 777
find PeopleSoft -type f | xargs chmod 666

LVL 68

Expert Comment

ID: 37018129
... the second command is a bit dangerous, because it could take away the "x" flag where it's needed.

So better use:

find PeopleSoft -type f | xargs chmod ugo+rw

Author Comment

ID: 37018955
So what does this command do?

Find PeopleSoft -type f | xargs chmod ugo+rw

it finds the PeopleSoft dir and applies what type of access?

I agree...your probably right on giving that much access. But I just need to have read/write/execute access to all those files.

Will that command give me that?
LVL 68

Accepted Solution

woolmilkporc earned 2000 total points
ID: 37019379
It finds all files (-type f) under the PeopleSoft directory and all subdirectories and gives each of them for:

u = user g = group o = others


r = read  w = write

This is essentially the same as "666", but permissions are applied additionally to which permissions already might exist.

-type d means directories

So "777" is the same as ugo+rwx, which latter will also extend permissions instead of overwriting them.

The easiest way to give each and every entity under "PeopleSoft" permisssions rwx for users, groups, others is indeed

chmod -R 777 PeopleSoft

where "-R" means "recursive".


LVL 48

Expert Comment

ID: 37020440
Rather than giving open permissions, you would be much better off setting the ownership, eg:

chown -R username PeopleSoft

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question