how to remove permissions for 'others' only


 
Thread Tools Search this Thread
Operating Systems Solaris how to remove permissions for 'others' only
# 1  
Old 06-04-2008
Question how to remove permissions for 'others' only

Hi expert,
I want to remove 'others' permission completely while maintaining 'owner' and 'group'.

Thanks.

-rwxrw----
-rwxrw--w-
-rwxrwxr-x
-rwxrwxrwx
-rwxrwxr-x
-rwxrwxr-x
-rwxrw----
-rwxrw----
-rwxrw----
-rwxrw----
drwxrwxr-x
drwxr-x---
-rwxrwxr-x
-rwxrw----
-rwxrwxr-x
# 2  
Old 06-04-2008
Code:
chmod 760 <filename>

Owner will have full access,group will have read and write access and others won't have any access.

The owner and group accesses can be changed as per requirement.

For more information

Code:
man chmod

# 3  
Old 06-04-2008
Hi ,
I've omitted some entry. I've many files and folders more than 100 of them with other permissions as well. ( i.e groups has different combination of permissions as well ).

-rwx------
-rwxr-x---
-rwxr-----

Is there any other way to do it rather than changing manually one by one ?
Thanks.
# 4  
Old 06-04-2008
It would be better if u use
chmod o-7 *

It will remove all permissions for others in all the files and subdirectories in current directory.
# 5  
Old 06-04-2008
Thanks. That's what i'm looking for.
# 6  
Old 06-04-2008
If you wanted to traverse all of the subdirectories and their files too? You would need

chmod -R o-7 *

The -R will recursively go through everything from where you are and below.
# 7  
Old 06-04-2008
Hi , I've got problem changing it. HELP !!!

root@host1:/abc/def/ghi/# chmod o-7 *
chmod: ERROR: invalid mode

Last edited by skully; 06-04-2008 at 10:34 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. Post Here to Contact Site Administrators and Moderators

Please remove this post/remove information from it

In this thread: /shell-programming-and-scripting/255687-organizing-text-file-capital-names-capital-word-capital-word.html (sorry i cant use links) that is not an example, those are real students names with real student login id's for the college i am attending and i am on that list. Please... (3 Replies)
Discussion started by: throwawayacc
3 Replies

3. Shell Programming and Scripting

remove brackets and put it in a column and remove repeated entry

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (2 Replies)
Discussion started by: manigrover
2 Replies

4. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

5. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

6. HP-UX

Permissions

Hey, We've got quite a strange problem on our hands here. We are running an HP 9000/800 B.11.00. I've just created a new group in /etc/group which i called, let's say newgroup . Then I added 4 users to the group, namely user1, user2, user3, user4 . The command grpchk shows no strange things... (4 Replies)
Discussion started by: chrizz
4 Replies

7. Forum Support Area for Unregistered Users & Account Problems

no permissions

I am having problems editing my profile, performing a search, etc .... Always get msg that I don't have any permissions. What do I need to do? Thanks DANNYC (1 Reply)
Discussion started by: DANNYC
1 Replies

8. UNIX for Dummies Questions & Answers

help with permissions

Can anyone help explain the "s" in the below permissions example. I was reading about the "sticky bit" (t) but I am a little confused. On file "test" wolf% chmod 4777 test wolf% ls -l total 4 drwx------ 2 john staff 512 Mar 19 21:34 nsmail -rwsrwxrwx 1 john staff ... (2 Replies)
Discussion started by: finster
2 Replies

9. UNIX for Dummies Questions & Answers

smitty, remove user, remove directory as well..

hi, i am on aix. i used smitty to remove a user.. but then found that its directory still exists.... so i have to remove the directory manually... am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies

10. Shell Programming and Scripting

permissions

Can someone pleas tell me if there is something funny when it comes to unix permissions and PHP. When php creates a file in unix the owner is nobody...does this raise any issues, and if it does could someone please tell me a web site where I could read more about this. Thanks alot. John (2 Replies)
Discussion started by: jmg5
2 Replies
Login or Register to Ask a Question