If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > chmod command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-04, 16:39
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
chmod command

Hello
chmod 777 *.sh will alter permissions to all .sh files in the current directory.
Now, if I have lot of sub-directories and a lot of .sh files in all those sub-directories, while sitting in the parentmost directory, how can I alter
permissions using chmod all on one shot ??
Is there some flag/options to use so that not only my in my current directory .sh files but also all sub directory .sh files permissions will be changed. Thanks
Reply With Quote
  #2 (permalink)  
Old 05-13-04, 16:45
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
chmod -R *.sh
or
man find
Reply With Quote
  #3 (permalink)  
Old 05-19-04, 12:36
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
Hello,
I tried this. I have 2 problems -

1. I am in a directory called biotox. There are 15 sub directories beneath it.
Again these 15 sub directories have other directories beneath it too.
Now sitting in biotox directory, i tried to issue the chmod -R 777 *.sh ( to change permissions for all sh files in all sub directories.
The issue is actually the biotox directory doesn't have any .sh files under it . They are only in all the sub-directories. So I get

chmod: *.sh: A file or directory in the path name does not exist.


2. I went into a sub-directory called aaa under biotox where there are .sh files. I did chmod -R 777 *.sh
It changed the permissions for all .sh files directly under aaa directory but not the .sh files in the sub directories of aaa
How do I achieve this ? Am I going somewhere wrong ? Or could it be OS specific ?
I am on AIX 5.1

Thanks
Reply With Quote
  #4 (permalink)  
Old 05-24-04, 20:28
krishnakant krishnakant is offline
Registered User
 
Join Date: Mar 2003
Posts: 23
Try find . -name "*.sh" -exec chmod 777 {} \;
Reply With Quote
  #5 (permalink)  
Old 05-24-04, 21:01
saccskiz saccskiz is offline
Registered User
 
Join Date: Feb 2004
Posts: 143
Great...that worked. Thanks a million
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On