Remove lock file method under Mac system

Source: Internet
Author: User
Tags error code

  under Mac OS X, files that cannot be deleted are no more than three cases:1, files (clips) are locked, 2 are in use; 3, files with no permissions (folders). Lock the file or folder icon under the small lock annotation, you can avoid the file inadvertently changed, moved or deleted, generally speaking, ordinary users do not give their own file lock habit. However, locked files can sometimes appear when you copy data and organize your system. These files cannot be removed from the current path, and a locked file or folder copy is generated under the target folder. Even if these stubborn guys get into the wastebasket, we can't use the usual method to remove them. So what should we do? This sticker "Apple Tips" will teach you a few tricks to completely remove these locked gadgets.

The locked folder itself cannot be moved directly, and the contents of its subdirectories cannot be changed, but the top-level folder is not affected by the lock. So, if you need to move a locked file, simply move the locked file or folder to the Trash or destination folder by moving the top-level folder.

Under Mac OS x, locking the file (folder) and unlocking the process is simple. Simply select the file (folder) that you want to lock or unlock, and then press the key combination "Apple+i" (or right-click "Show Profile" "Get Info") to check or accomplishments the lock option in the folder or file profile interface.

If you have multiple files or folders under a path that require locking or unlocking, you can select all of these files (folders) and then use the key combination "option+ Apple keys +i". All file information will be displayed in an introduction, as long as the check or accomplishments lock option is coherent. After the files and folders are locked, you cannot modify the owner and permissions from the introduction. If you attempt to modify, the system will eject a warning message indicating that the operation could not be completed, an unexpected error occurred, and an error code of 120. Locking a file (folder) prevents you or others from inadvertently being changed, moved, or deleted while using the computer. If you need to delete a lock file, the system will jump out of the prompt box:

You will see that the above dialog box has two choices: Stop and Continue (Continue). If you choose Stop, the empty trash will be canceled, so all the contents of the trash will be saved. If you choose Continue, other files or folders that are not set will be purged, except that the top-level directories of the locked files or folders are kept layered and the files in the locked folder and the first-tier subdirectories are retained. How many locked files exist in the wastebasket, and how many prompts to jump out when emptied, waiting for the user to choose whether to continue or stop the operation. The way that a locked file or folder is emptied immediately when the trash is emptied is by holding down the option key while the trash is dumped (key combination Apple keys, Shift, option, and delete). Of course, if you are an Apple freshman, fear accidentally deleted the system files. You can choose the safe Empty Trash from the Finder toolbar. The difference between clearing the trash and clearing the trash, in addition to the usage of a locked or running file or folder, the main thing is, the use of security to the waste basket after the original space will be the system automatically generated data occupied, the original file will not be retrieved, and "clear the Trash" Just clear the index information of the file, the damage to the file itself is not serious, if the Third-party software in a timely manner to repair or retrieve the deleted files.

  It is worth noting that some locked files or folders are grayed out in the "Show info" option and cannot be easily checked for unlocking. You can try the following steps to unlock:

1, open the terminal (Terminal) from the utility (Utilities)

2, Input: Chflags-r nouchg Space

3, pull the locked file (clip) to the terminal (Terminal), if there are several locked files or folders, you can select all and pull to the terminal.

4, enter.

When you select the file (folder) again, or when you restart the Finder, the icon for the file or folder lock should disappear.

  If the above method is not yet unlocked, you can try the following steps under Mac OS 10.4+:

1, reboot, hold down the Apple keys and s on startup

2, to enter the Black interface (after the cursor pause), input: Mount-uw/Enter, the system installed on the hard drive

3, enter:

Defaults Write/library/preferences/systemconfiguration/autodiskmount Automountdiskswithoutuserlogin-bool True

(Normally, Mac OS x allows a user to load a removable disk only after logging into the system.) The above command allows the system to load disks automatically when no user is logged on

4, Input: SH/ETC/RC carriage return. (The wait for cursor pause and return)

(The functionality provided in this step enables Single-user mode to do OS X logins like root user, except for user images without OS X)

5, type: Find/-flags schg-exec chflags noschg {}; carriage return

(The bank executes several commands to look for files with system-immutable bytes (immutable bit) from the root directory and then clears the bit. Since the bank is checked from the root directory, it is relatively slow. For a moment, wait until the cursor stops and proceed to the next step.

6, type: rm/library/preferences/systemconfiguration/autodiskmount.plist carriage return.

(This command deletes the file modified in the third step to restore the system)

7, type: Reboot carriage return

(The machine reboots itself)

After login, the stubborn locked file (folder) also disintegrated ^ ^

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.