Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-20-2011, 05:29 AM   #1
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
Find world writable directories.

I m writing a little script to check if a directory is world writable or not.

this is what i have achieved.

# find /tst -xdev -type d \( -perm -0002 -a ! -perm -1000 \)
this works well for directories who have set as world writable bit on by following.
chmod 777 /tst
However above code doesn't work for /tmp as it is also world writable.
Please help.
Old 05-20-2011, 05:38 AM   #2
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 37
I guess this would be much easier.

find /root/Desktop -maxdepth 0 -type d -perm /o+w
The only problem is that above command only checks for world writable directories but how would i add group writable directories too.
I guess this should work
find /tst -maxdepth 0 -type d -perm /o+w,g+w

Last edited by pinga123; 05-20-2011 at 05:44 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find root owned world writable files? pinga123 Linux - Newbie 23 10-14-2010 07:30 AM
world writable directory? turbo_acura Linux - Software 8 10-17-2009 07:02 AM
crontab and world-writable directories? wy1z Linux - Security 2 01-25-2008 01:38 AM
World Writable Files ilago Linux - Security 4 10-06-2007 11:21 PM
sendmail world writable directory jbrearley Linux - Software 0 07-01-2004 12:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration