Find File with permission below 664


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find File with permission below 664
# 1  
Old 03-03-2009
Find File with permission below 664

Hi
Using find i want to find files with permission below 664.
# 2  
Old 03-03-2009

What does "below" mean? Is 177 below 664? Is 1000?

Code:
man find

Read about the -perm test.
# 3  
Old 03-03-2009
I am making a script.I have read man and test it out.I know we can use some thing like this
Code:
find /abc -type f \! -perm  664

But this gave me files which are not 664.I want to find files in a directory have permission below 664.or less then 664.is there any way in find we can achive it.
# 4  
Old 03-03-2009
As Chris said - please define below 664? We cannot possibly help you otheriwse.
# 5  
Old 03-03-2009
I guess then its not possible.I want all file which is less the 644.less then 664 can be any file permission.i dont want any specific
# 6  
Old 03-03-2009
Those numbers are created by testing for set bits from the stat structure element called st_mode.
Code:
rwx=7
rw-=6
r-x=5

and so on.

You have three bits for each number 6 (user or owner) 6 (group permissions) 4 (other or world permissions)
664 = rw-rw-r


They are not really addition or subtraction.
# 7  
Old 03-03-2009
Quote:
Originally Posted by aliahsan81
I guess then its not possible.I want all file which is less the 644.less then 664 can be any file permission.i dont want any specific

It may be possible (most things are), but if you don't tell us what "less than" means in this context, we can't help you.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with using find for other permission

Hi, I am using the following find command to search for file permissions that I have to correct find . -perm 777 -type f -print find . -perm 777 -type d -print I then do a chmod o-w,o-r,o-x to make them not not 777. I am also needing to search for where the others has... (1 Reply)
Discussion started by: newbie_01
1 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. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

4. UNIX for Dummies Questions & Answers

How to find out who changed the file permission in unix

Can any one tell me is there any command to find out who changed the permission of a file Or is there any log file so that i can find out who has changed the permission of a file? Thanks in Advance:) (7 Replies)
Discussion started by: Uttamnsd
7 Replies

5. UNIX for Dummies Questions & Answers

Find - prints Permission denied

Hi, I'm trying to search for files with a particular pattern using the below command. find . -name file_1.txt -print It gives Permission denied error on several files, using standard error, how do we ignore this error and print only the valid matches. find:... (1 Reply)
Discussion started by: Dev_Dev
1 Replies

6. Shell Programming and Scripting

Find without the "Permission non granted" list ...

Hi, When I use the Find command under the root directory ("/") of my Ubuntu, I get the good answers mixed inside a long list of "Permission non granted" (in fact and with my French version, I get "Permission non accordée" !). After several unsuccessful tries with -perm or -executable options... (4 Replies)
Discussion started by: Micla
4 Replies

7. Fedora

Find Files in Directory by Permission?

Hello. I need to write a script that lets the user pick a directory. Then, all files are looped through, and the ones with read-write (for current user I think) are listed. Ending with a count of those files, but that parts easy. What I'm confused about is the middle. So far I have ... (15 Replies)
Discussion started by: Feuyaer
15 Replies

8. Cybersecurity

file permission/acl: 2 users with write access on 1 file...

Hello, i need some help/advice on how to solve a particular problem. these are the users: |name | group | ---------- --------------- |boss | department1 | |assistant | department1 | |employee | department1 | |spy | department2 | this is the... (0 Replies)
Discussion started by: elzalem
0 Replies

9. UNIX for Dummies Questions & Answers

Find who has permission to delete

All, I am running a script , which has permision as below -r-xr-x--- 1 pmgr ffw 11660 Sep 3 2003 ccln and tring to delete the file in the directory inter (sys212:pct:/>) ll | grep ^d dr-xr-xr-x 32 bin bin 8192 Dec 24 03:24 etc drwxr-xr-x 32... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies
Login or Register to Ask a Question