Solaris 10:
To copy permissions (and ACLs):
To apply permissions
<edit> This doesn't change the owner of the directory
To identify ownership and permissions of a directory:
[code]ls -l /path/that/source/directory/is/in | grep directory[code]
Then change the ownership of the new directory:
The permissions will appear as -rw-rw-rw or -rwx------ or something of that ilk
The first 'digit' will usually be -, but may be 4, 2 or 1 (depending on what has been configured - run a man on chmod for more details)
The next 3 sets of digits are the permissions for owner, group, and others (respectively).
To change the permissions of a directory, you will need to identify who needs
Understanding (r)ead (w)rite or e(x)ecute involves some math:
For:
So, to set Read & Write for the OWNER only, you would:
</edit>
I could probably use that method and then make a shell script out of it. However, I was wondering if there was an easier way to get the permissions in plain number format rather than using ls and doing the conversion.
@chompy
That works, but unfortunately I don't want to copy the entire directory, just its permissions.
Hello,
I'm pretty new to scripting and trying to do a simple (well, I thought so) administrator task. I'm using bash.
I want to create 10 directories under the one directory and apply permissions at the same time.
I've worked out the make directories part: mkdir /userdata/folder{1..50}... (7 Replies)
Hi Team,
I want to set permissions to one folder in such a way that the user can write files or create folder inside that but should not able to delete it.
Basically reason behind this is i am using Pidgin Messenger. There is a directory of logs in which, when user chat its store his logs.... (2 Replies)
Hi,
Need to compare two folders / File systems permissions & time stamps including sub folders and files.
Kindly let me know if any commands available.
Regards :: VM (1 Reply)
I am using the below command to delete files from directories and subdirectories
find /test/abc/xyx -type f -mtime +7 -exec rm -f {} \;
there are some subfolders in xyx for which i don't have permission to delete.
Is there a way i can check the permission of the folder first and then delete... (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Copying all the normal files from 1 folder to another on a unix platform. I pass in 1 or 2 arguments, the folder... (0 Replies)
Hi everyone,
I am using mac os x 10.6, and I just copied over a project from a machine with 10.5... And I noticed my ls color is very funky in this directory... I found that my permissions are all messed up, and am wondering if there is a way to recursively fix permissions?
This is how they... (3 Replies)
Hello all, this is my first post while i am trying to understand unix.
I would basically like to know if i can do this:
Lets say i have a folderA and folderB
And i save something in folderA
Can i make a script that checks folderA latest file, then compares it with the date of latest file in... (16 Replies)
Hi all,
I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt.
I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
I work for a big company and all the people within my unit share a common drive to save documents to. I am listed in the group(AMS group) that has access rights to folders within this drive. but i'm trying to restrict access to a confidential folder so that only I can access it.
when I set the... (0 Replies)