unlocking multiple files

I've got a bunch of files on my mac that came from a pc. for some reason they're all locked. i'm trying to overwrite these files and i can't because they're locked. i know that i can unlock through the info. dialogue box but is there a way to unlock multiple files all at once?

thanks,

ben

Posted on Oct 27, 2005 2:22 AM

Reply
1 reply

Oct 27, 2005 6:41 AM in response to Benjamin Parco

I don't know of a way to easily unlock multiple files in the GUI. But you could do it from the command line. And you could probably wrap the shell command with an AppleScript if you wanted to create your own GUI tool for doing this.

The Finder "locked" flag corresponds to the Unix "uchg" (user immutable) flag. You can change the "uchg" flag with the "chflags" command line tool. See "man chflags" for the details.

Basically, if all the locked files are contained in the same folder you could do something like this:

chflags nouchg /path/to/folder/*


Using the "*" on the end of the path should tell the command to attempt to unlock every file in the folder. Or you could do individual files like this:

cd /path/to/folder; chflags nouchg file1 file2 file3...


Another alternative, if the files are located in various locations and you don't want to type the complete path to each file is to type this in Terminal:

chflags nouchg<space>


Do NOT press return yet and where I've included <space> you should type a space with the spacebar. Once you've got that typed into Terminal you can drag files from the Finder and drop them into the Terminal window. Each time you drop a file into the Terminal window it's full path will be appended onto the end of the command (including a trailing space so you can drop additional files). Once you've dragged all the files to Terminal, then press the <Return> key to execute the command.

Steve

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

unlocking multiple files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.