Mac basic commands

Source: Internet
Author: User

Ls Parameters

Directory Name example: to see what is in the root directory,
Ls/want to see what is in the driver directory,
The LS/system/library/extensions parameter-W displays Chinese characters and-l details.-A includes hidden files.

Conversion directory
CD example: Think of a drive directory with a circle of CD/system/library/extensions

Create a new directory
Mkdir directory name
For example, create a backup directory under the driver directory, backup mkdir/system/library/extensions/backup, and create a backup directory on the desktop, backup
Mkdir/user name/desktop/backup

Copy an object
CP parameter source file target file
For example, you want to set the natit of the desktop. copy kext to the driver directory CP-r/user name/desktop/natit. the kext/system/library/extensions parameter r indicates recursive operations on the directory. kext looks like a file in the graphic interface and is actually a folder. Back up all files in the driver directory to the desktop
Backup CP-r/system/library/extensions/*/user name/desktop/backup

Delete an object
Rm parameter file
For example, you want to delete the drive cache Rm-RF/system/library/extensions. kextcache Rm-RF/system/library/extensions. mkext parameter-RF indicates recursion and force, so be careful when using it. If you run Rm-RF/your system, it will be all gone.

Move files
MV File
For example, you want to set applehda. kext moves to the desktop mV/system/library/extensions/applehda. kext/user name/desktop want to apphda. move kext to the backup directory mV/system/library/extensions/applehda. kext/system/library/extensions/backup

Change File Permissions
Chmod parameter permission File
For example, set all files in the driver directory to root for read/write. Other users read-only chmod-r 755/system/library/extensions parameters R to recursive, 755 indicates the permission of each user to change the file owner chown parameter User: group file example: change all file owner in the driver directory to the root user chown-r root: the wheel/system/library/extensions parameter r indicates that recursive operations are performed to fix the diskutil repairpermissions of files in the entire system. Strictly speaking, this is not a Unix Command, but an OSX software, remember to run the modified or added driver once.

Text editing
Nano file name
For example, edit natit info. plist nano/system/library/extensions/natit. kext/info. after plist editing is complete, use Ctrl + O to save the disk. CTRL + X to exit from another text editing software VI, which is a little odd and easy to use, and in all UNIX-like systems, it is not afraid to go all over the world.

Run the script command
Sh script file name
For example, after the driver is modified, all required operations are saved as a script. After the driver is modified, you only need to run the script once. 1. Run nano/clean on the terminal.
2. paste the following code into the nano Rm-RF/system/library/extensions. kextcache Rm-RF/system/library/extensions. mkext chown-r root: wheel/system/library/extensions chmod-r 755/system/library/extensions diskutil repairpermissions/kextcache-k/system/library/extensions/
3. Press Ctrl + O to save the disk, press Ctrl + X to exit
4. Run sh/clean once on the terminal as long as the driver is activated.

Tips
For example, enter CD/sy in the/system directory and press the tab key, the command will automatically compress the file and directory spaces with spaces in the name of the CD/system operation into \ spaces in the command, for example, to enter my documents, the command is CD my \ Documents ents

View Detailed Help of commands
For example, to view the detailed usage of the LS command, Run man ls

Mac basic commands

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.