LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-25-2005, 01:14 PM   #1
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Changing Permissions


Greets.

I have a directory with files where certain ones need to have the permissions changed. Everything thats 775 I want to be 755, likewise 664 to 644...

cd directory
find . -perm 775 | xargs chmod 755
find . -perm 664 | xargs chmod 644

That doesn't work and by all rights it should... It errors out stating that that it wants some additional chmod arguments... Suggestions? Theres quite a few of them. I really don't want to do it by hand.... Thanks for your feedback.

Jon
 
Old 01-25-2005, 01:27 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Works for me, but only if there are files to change, thats when I get the error your reporting.

Try the find on its own and see whats actually being listed.
 
Old 01-25-2005, 01:36 PM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Original Poster
Rep: Reputation: 52
Hah,hah... Ahhhh.. Funny. Sometimes you just need to state the obvious I guess... I did alot of stuff last night and forgot I had done that already. Found the commands in my bash_history... Thanks...
 
Old 01-25-2005, 01:46 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by leonscape
Works for me, but only if there are files to change, thats when I get the error your reporting.

Try the find on its own and see whats actually being listed.
To avoid the errors give the pipe a miss ...

Instead of
Code:
find . -perm 775 | xargs chmod 755
use
Code:
find . -perm 775 -exec chmod 755 {} \;
(quite frankly I find that more elegant, too ;})...


Cheers,
Tink
 
Old 01-25-2005, 02:20 PM   #5
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Original Poster
Rep: Reputation: 52
Nice... Thanks Tink. Using consecutive commands like I mentioned above in a script will result in it bombing out, or rather, it just freezes. After leonscape posted, I realized I had another problem. You must have read my mind.

I spoke too soon. It still freezes up. Crap. That irritates me.

Ahh... Problem with some other command down the line. Nevermind. Need to put the computer down. Just not thinking clearly today. Thanks again.

Last edited by jong357; 01-25-2005 at 02:37 PM.
 
Old 01-25-2005, 02:39 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If you have files with spaces (or other 'stupid' characters)
in the name in that directory try putting "" around {} ...


Cheers,
Tink
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing permissions sy-co Mandriva 5 04-16-2004 10:13 AM
Changing Many Permissions at Once food188 Linux - General 3 11-02-2003 08:17 AM
Changing Permissions synecdoche Linux - General 1 08-21-2003 10:41 AM
Changing Permissions linuxfond Linux - Newbie 11 07-01-2003 02:48 PM
Permissions Changing ew2003 Linux - Newbie 1 04-29-2003 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:09 AM.

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