How to find out in which directories a user can write?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to find out in which directories a user can write?
# 1  
Old 07-14-2009
How to find out in which directories a user can write?

Hi everybody,

what command can show me the directories in which a certain user can write to?

Kind Regards
FranzB
# 2  
Old 07-14-2009
I've simplified this out, because one of my OSes doesn't like a "combined" find it gives wrong results.
assume the username is john and the group number is 1140
Code:
# john is owner
find . -type d -user john -exec ls -ld {} \;
# john's group has write
find . -type d -group 1140  -perm -0020 -exec ls -ld {} \;
# world (other) has write
find . -type d -perm -0002 -exec ls -ld {} \;

Change the "find ." to the directory tree you want to search through e.g.,
find /home
# 3  
Old 07-14-2009
Quote:
Originally Posted by jim mcnamara
I've simplified this out, because one of my OSes doesn't like a "combined" find it gives wrong results.
assume the username is john and the group number is 1140
Code:
# john is owner
find . -type d -user john -exec ls -ld {} \;
# john's group has write
find . -type d -group 1140  -perm -0020 -exec ls -ld {} \;
# world (other) has write
find . -type d -perm -0002 -exec ls -ld {} \;

Change the "find ." to the directory tree you want to search through e.g.,
find /home
Thank you very much. Thats what i was looking for.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies

2. UNIX for Dummies Questions & Answers

Loop over certain user directories and find files

Hello I have user directories that contain /temp directory. Example folders: /user1/temp/ /user2/temp/ /user3/temp/ How can i loop over all user directories and find all files only in their /temp folder? Thanks a lot for help! (3 Replies)
Discussion started by: flavius42
3 Replies

3. AIX

find command to list all the 777 files and directories owned by root user

Hi I'm logged in to an AIX box now and we need to do an audit on this box. cbssapr01:# pwd / Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies

4. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

5. UNIX for Dummies Questions & Answers

find directories owned by a given user

Hi, I want to know if the is a way I can list the directories owned by a given user. Say i am logged in as that user. I found out the find command lists the files owned by a certain user/group but i want to know only the directories and if possible the permissions associated with these... (6 Replies)
Discussion started by: poojabhat
6 Replies

6. Shell Programming and Scripting

Find the total size of all directories that are owned by a particular User

Hi All, I am writing a script in which i need find the total size of all the directories that are present in a directory which are owned by a particular user. I will explain in details i have a dir DIR1 in which i have 5 dir's DIRA DIRB DIRC DIRD DIRE. DIRA DIRC DIRE are owned by "eswar" i... (2 Replies)
Discussion started by: firestar
2 Replies

7. Shell Programming and Scripting

How to find 777 permisson is there or not for Directories and sub-directories

Hi All, I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders Under APPL_TOP (Folder/directory) with below conditions i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc) and exclude the directory... (11 Replies)
Discussion started by: gagan4599
11 Replies

8. Shell Programming and Scripting

Giving write permission to multiple directories

Hi, i am having following directory structure Folder1 -> Folder2 -> Folder3 Folder4 Folder5 Now i am at top level and want to assign write permission to all the folder & files in it. i am... (3 Replies)
Discussion started by: sarbjit
3 Replies

9. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
Login or Register to Ask a Question