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

Posted on 2011-10-24
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
    LVL 68

    Expert Comment


    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

    ... 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

    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

    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

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

    chown -R username PeopleSoft

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now