Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

opusthe2nd

macrumors 6502
Original poster
Sep 5, 2005
429
0
I manually imported files from an old TM backup. They are all locked, I want to unlock them so I can randomly delete them. How do I correct this issue?? Folders and sub-folders in one fell swoop.
 

mrapplegate

macrumors 68030
Feb 26, 2011
2,818
8
Cincinnati, OH
I manually imported files from an old TM backup. They are all locked, I want to unlock them so I can randomly delete them. How do I correct this issue?? Folders and sub-folders in one fell swoop.

You can google it :rolleyes:

In terminal type

chflags -R nouchg /PATH/TO/DIRECTORY/WITH/LOCKED/FILES/
 

opusthe2nd

macrumors 6502
Original poster
Sep 5, 2005
429
0
You can google it :rolleyes:

In terminal type

chflags -R nouchg /PATH/TO/DIRECTORY/WITH/LOCKED/FILES/

I did Google it and got the same thing you said. I proceeded to do it and it said no go. I since tried to delete them and it DOES work, regardless of the error it spit out at me.
 

opusthe2nd

macrumors 6502
Original poster
Sep 5, 2005
429
0
Scratch that, I just tested it in 10.8.2

I can lock a set of files in a fodder using
chflags -R uchg /Users/thor/Desktop/Test

but can't unlock using
chflags -R nouchg /Users/thor/Desktop/Test

Strange.

Thats what I thought, I did it and I can now delete. Who knows!
 

DeepIn2U

macrumors G5
May 30, 2002
13,051
6,984
Toronto, Ontario, Canada
Unlock All Files in Folder OSX 10.8 - Solution

I was digging around and the command in terminal you need to use is


chflags -R nouchg *

Thus in "mrapplegate" issue ... the solution is
chflags -R nouchg * /Users/thor/Desktop/Test

(the asterisks was missing).
Solution Find on: http://www.mehtanirav.com/2009/04/16/recursively-unlock-files-on-mac-os-x/

Recursively unlock files on Mac OS X
with 7 comments

I copied some songs from a CD and ended up with a folder full of locked files. iTunes can’t save changes to song info (ID3 tags) until I unlocked them. How can you unlock files recursively on Mac OS X?

If you have a folder full of locked files on Mac OS X, you can quickly unlock all of them recursively with the following command. Open a Terminal, go to the folder containing locked files, and type:

chflags -R nouchg *

An excellent introduction to chflags on Mac OS X Hints. Here’s an excerpt:

In addition to the standard UNIX permissions (read, write, execute for owner, group, other), OS X has a few flags that can be set on files and folders to make them locked.

These flags supersede the standard UNIX permissions. If a file is locked, that overrides the write permissions so that applications treat the file as read-only. If a folder is locked, no files can be added or removed from that folder, no matter what the write permissions on the folder are. These restrictions apply to all users, independent of the permissions that are set on the files or folders. They even apply to the root user (or to admin users using sudo).

Read more about chflags at Mac OS X Server FAQ.
 
  • Like
Reactions: austenl
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.