Visit Our UNIX and Linux User Community

Change Rights Recursive with chmod

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change Rights Recursive with chmod
# 1  
Old 07-16-2010
Change Rights Recursive with chmod


i want just to change Rights for a few direcories anf files, but some directories must be exclude.

How can i put the command chmod as

chmod -R 755 * exclude toto tata

where toto and tata are directories

Could you help me for that or must I use the find command

# 2  
Old 07-16-2010
I do not know a version of chmod that allows a exclude list. So you you could create a list with the find command and remove with grep -v those you do not want and then feed that list in a while/read loop to chmod, for example.
# 3  
Old 07-16-2010
This will help you out

ls -1 | egrep -v "toto|tata" |  xargs chmod 755

Previous Thread | Next Thread
Test Your Knowledge in Computers #925
Difficulty: Medium
The earliest versions of Unix time had a 32-bit integer incrementing at a rate of 60 Hz.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change chmod on files in diff directories

I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status. Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies

2. Shell Programming and Scripting

Change the permission to previously used in unix ( chmod )

I have changed the premission of a file to 777. Now I would like to change permission to previously used ( UNDO ). Is there any command ?:confused: (3 Replies)
Discussion started by: frintocf
3 Replies

3. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

4. UNIX for Dummies Questions & Answers

chmod -R recursive flag

Hi, why can't I use the flag -R recursive ? ftp> chmod -R a+xwr kickstart usage: chmod mode remote-file ftp> chmod a+xwr kickstart 200 SITE CHMOD command successful thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

5. Shell Programming and Scripting

change file type to hidden using chmod command

I want to make a hidden file with chmod command. Example: I have a file name inputfile.txt -rw-r--r-- 1 xxxxxx xxxxxx 1388 Sep 12 05:41 inputfile.txt I want to hide that file using chmod command. Please tell me if it is possible or there is some other way to do this. Thanks... (2 Replies)
Discussion started by: rinku
2 Replies

6. UNIX for Advanced & Expert Users

recursive chmod that only affects directories?

The man page for chmod doesn't list a way to recursively change permissions on directories only, without affecting the files themselves. Let's say that I wanted to change the permissions on the current directory and all subdirectories. I know I can write a bash script that would do this using... (1 Reply)
Discussion started by: retrovertigo
1 Replies

7. UNIX for Advanced & Expert Users

change permission chmod

Hi, when I launch my perl script, I write on the shell: perl How I can can change the permission to write only: x to launch the program? (2 Replies)
Discussion started by: Minguccio75
2 Replies

8. HP-UX

User rights

I wan to create a user e.g. Tom. whenever a file is created by user Tom or FTP is done using user as Tom, the rights on the file should be 777 (by default). how can I achieve this. Please help. Its very urgent. (1 Reply)
Discussion started by: sharmavr
1 Replies

9. UNIX for Dummies Questions & Answers

chmod rights issue?

I want to grant the 'write' right to one user so they can delete log files in a given directory. These are http log files, so a new one is created each day. The file owner is 'nobody'. If I use the command 'chmod a=rwx *' will this work for the new files created each day. I've tried the... (7 Replies)
Discussion started by: Westy564
7 Replies

10. UNIX Desktop Questions & Answers

Groups Rights

I just created a group. How do i make the groups read only to a specific file systems.(home directory). (3 Replies)
Discussion started by: niasdad
3 Replies

Featured Tech Videos