Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] test for *other* write permissions



On Thu, 15 Nov 2012 22:38:43 +0000
"Edward Ned Harvey (blu)" <blu at nedharvey.com> wrote:

> If using "find" you can test that a file is writable by yourself -
> but not test if it's writable by anyone else.

I disbelieve. The -perm option allows you to specify a permissions
list to match. Execute is 1, write is 2, read is 4. Owner is the first
digit, group is the second and other the third. Leading zeros are
optional.

$ touch it
$ chmod 000 it
$ chmod o+w it
$ find . -name it -perm +002 -ls
825789    0 --------w-   1 ratinox  ratinox         0 Nov 15 20:27 ./it
$ find . -name it -perm +200 -ls
$
$ chmod 007 it
$ find . -name it -perm +002 -ls
825789    0 -------rwx   1 ratinox  ratinox         0 Nov 15 20:27 ./it
$ chmod 700 it
$ find . -name it -perm +002 -ls
$


-- 
Rich P.



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org