Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 12, 2010, 11:04 PM   #1
darakok
macrumors newbie
 
Join Date: Jul 2010
sudo chmod: operation not permitted

Dear mac users,

I want to change permission on a file using this command below, but it doesn't work. it seems there is a permission problem or the file is locked in some way.

what i get as a result is:
Code:
sudo chmod g+rwx "Copy of index.php" 

chmod: Unable to change file mode on Copy of index.php: Operation not permitted
the error happens when i try to change file owner ship. There are other files in the folder, and my above command works except this one file.

Please help.
darakok is offline   0 Reply With Quote
Old Dec 13, 2010, 03:59 AM   #2
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by darakok View Post
Dear mac users,

I want to change permission on a file using this command below, but it doesn't work. it seems there is a permission problem or the file is locked in some way.

what i get as a result is:
Code:
sudo chmod g+rwx "Copy of index.php" 

chmod: Unable to change file mode on Copy of index.php: Operation not permitted
the error happens when i try to change file owner ship. There are other files in the folder, and my above command works except this one file.

Please help.
To test, I created a new file and then locked it. I then entered your command and received the same message you received. So it seems your guess about the file being locked is correct.

You can try to unlock the file using Finder:

1) In the Finder Go menu, choose Go to Folder.

2) Type in the path to the folder that contains the file, and then click Go.

3) In the window that opens, select the file and then select Get Info from the Finder File menu.

4) In the panel that opens, uncheck the Locked box in the General section of the panel.

(This can also be accomplished from Terminal using the SetFile command, but unless you've installed the Developer Tools, I don't think you have this command on your system.)
LPZ is offline   0 Reply With Quote
Old Dec 13, 2010, 10:17 AM   #3
Hal Itosis
macrumors 6502a
 
Hal Itosis's Avatar
 
Join Date: Feb 2010
Quote:
Originally Posted by LPZ View Post
(This can also be accomplished from Terminal using the SetFile command, but unless you've installed the Developer Tools, I don't think you have this command on your system.)
SetFile (and Dev tools) not needed.

chflags nouchg
/path/to/item

will do that trick as well (and chflags comes on all OSX Macs).

--

Probably the most important command for users to learn is ls

ls -lOe
/path/to/item

will show what's preventing the mode change.
Could be a lock (flag) or could be an ACL too.
__________________
-HI-
Hal Itosis is offline   0 Reply With Quote
Old Dec 13, 2010, 10:48 AM   #4
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Hal Itosis View Post
SetFile (and Dev tools) not needed.

chflags nouchg
/path/to/item

will do that trick as well (and chflags comes on all OSX Macs).

--

Probably the most important command for users to learn is ls

ls -lOe
/path/to/item

will show what's preventing the mode change.
Could be a lock (flag) or could be an ACL too.
Thanks. Sadly, I'll forget this before I need it again.
LPZ is offline   0 Reply With Quote
Old Dec 13, 2010, 09:25 PM   #5
darakok
Thread Starter
macrumors newbie
 
Join Date: Jul 2010
Thanks alot everyone, it works now.
darakok is offline   0 Reply With Quote
Old Aug 28, 2012, 05:00 PM   #6
dmass
macrumors newbie
 
Join Date: Aug 2012
thanks

thanks . you save me .
dmass is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Error 1 operation not permitted, terminal not working SuperHero87 OS X 4 May 20, 2014 02:04 AM
Automator chmod permissions help drjustice Mac Basics and Help 0 Dec 17, 2013 06:54 AM
Resolved: NSFileManager copyItemAtPath Operation not permitted Tex-Twil iPhone/iPad Programming 14 Sep 25, 2013 08:41 AM
Are animated GIFs permitted in ads? FloatingBones Site and Forum Feedback 6 May 21, 2013 06:04 PM
Networking Issue -- Outbound Connections Not Permitted NightStorm Mac OS X 10.7 Lion 1 Jul 2, 2012 09:40 AM

Forum Jump

All times are GMT -5. The time now is 11:21 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC