Archives for 苹果终端技术

true fix system problem with unix command line

If you’re having system problems and want to clean the disk, check partitions, and so on, here’s a way to fix problems without any third-party applications: Start up in single-user mode, and run FSCK. Uh, what was that?
FSCK stands for “file system check,” and the –fy you’ll type just says to go ahead and fix any problems it finds. Here’s the drill:
1    Restart your Mac.
2    Immediately press and hold Command + Option + S. You’ll see a bunch of text begin scrolling on your screen. (Cool, you’re now a geek.) Soon you’ll see the Unix command line prompt (#). Don’t cry; it’s still your Mac—you’re just a true Unix god—well, demi-god.
3    Type fsck -fy (that’s fsck + space + minus + f + y).
4    Press Return.
The FSCK utility will do its magic, running some text across your screen. If there’s damage to your disk, you’ll see a message that says: “FILE SYSTEM WAS MODIFIED.”
If you see this message, it found some problems and fixed them—repeat steps 1 and 2 until that message no longer appears. It’s normal to have to run FSCK more than once; the first run’s repairs often uncover additional problems.
When FSCK finally reports that no problems were found and the # prompt reappears, type reboot to restart or type exit to start without rebooting. Then press Return.