search files with owner having execute permission


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting search files with owner having execute permission
# 1  
Old 05-06-2010
search files with owner having execute permission

Hi All,
I have to search for all files in the current directory where the owner having execute operation.

I can find the files with specific permission such as 666

Code:
find . -type f -perm 666

But how to find files with only execute permission to user.

tried with :
Code:
 
find . -type f -perm 6?? and
find . -type f -perm 6[??]


I think i have to write a script for this else it cant be achieved.
Any suggestions plz.

Moderators,
Its ok.. dont give me answers .. atleast hintss .. plz
# 2  
Old 05-06-2010
Code:
find . -type f -perm -100 -ls

# 3  
Old 05-06-2010
but it will work where the owner has only execute permission
if the owner will have some other permision added to execute it wont show

Sorry, If i was not clear in describing my issue in prev post

---------- Post updated at 10:06 PM ---------- Previous update was at 09:23 PM ----------

but it will work where the owner has only execute permission
if the owner will have some other permision added to execute it wont show

Sorry, If i was not clear in describing my issue in prev post

---------- Post updated at 10:07 PM ---------- Previous update was at 10:06 PM ----------

[QUOTE=gotam;302419168]but it will work where the owner has only execute permission
if the owner will have some other permision added to execute it wont show

Sorry, If i was not clear in describing my issue in prev post
# 4  
Old 05-06-2010
Permissions 666 mean that nobody has execute permissions.

If you want to find files where ONLY the owner has execute permissions we are looking for permissions 700 or 300 or 100 . Further to scottn post above we can exclude files where group or other have execute permissions with this find:

Code:
find . -type f \( -perm -000100 -a ! -perm -000010 -a ! -perm -000001 \)  -print


Note that when the -perm parameter is prefixed with a hyphen it becomes a mask not an absolute value.


Try it with different files.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for files owned by particular owner and group

I am searchingfor files owned by particular owner and group in a particular directory including its sub-directories. I use find <dir> -user <user> -group <group> -exec ls -l {} \; It does not work completely. In the sense is a subdirectory is owned by 'user' and group 'group' then all... (9 Replies)
Discussion started by: Soham
9 Replies

2. Shell Programming and Scripting

Find list of files missing read & execute permission

Hi, I'm writing a post-upgrade script and I want to find which files don't have read and execute to everyone. I can run a find . ! -perm, but then I have to use a list of the possible permissions (777,775, 755 etc). Is there a more elegant solution? Thanks (2 Replies)
Discussion started by: Catullus
2 Replies

3. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

4. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

5. HP-UX

owner Permission changed automatically

HI all, We had created new user using the command useradd -d /home/selva -s /usr/local/bin/bash selva. But it didnt created the home directory on /home. So i manually created, copied skel files manually and changed the owner from root to selva. At the same time i observed that so many files... (6 Replies)
Discussion started by: selvaforum
6 Replies

6. Shell Programming and Scripting

search any user files with write permission

Guys, i wanna get any user files with write permission (on user or group permission) for review but i confuse with -perm parameter. any body can help me to explain what is that mean? thank's (1 Reply)
Discussion started by: michlix
1 Replies

7. UNIX for Dummies Questions & Answers

Using find to search for any owner having execute permissions.

Hi I need help. I need to use find (or grep I don't care) to recursively search for files who have any kind of executable permissions (group and/or owner and/or other). I am looking for *.c and *.h This what I am using now: find . -name *.h -perm -111 -print but I don't want to retype that... (4 Replies)
Discussion started by: dissectcode
4 Replies

8. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

Hi all, We have some files are under 744 permissions and the the owner is say owner1 and group1. Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that. ... (14 Replies)
Discussion started by: TheGunMan
14 Replies

9. Programming

how I know owner of file and its permission through c program

Helo I havea particular file. how I know ownerof the file as well as file permission using c program. Regards, Amit (4 Replies)
Discussion started by: amitpansuria
4 Replies

10. Shell Programming and Scripting

permission, owner and group

hello I search a script (ksh for Aix 5.3) to save all permissions, groups and owner for all files. Because we work much to change it, and a mystake ......! So i want execute this script to save/ execute permissions for all files. If you have this script, thank you for your help ;) best... (2 Replies)
Discussion started by: pascalbout
2 Replies
Login or Register to Ask a Question