First, the basic command
1. List files
LS parameter catalog name: see what's in the drive directory: ls/system/library/extensions
Parameter-W displays Chinese,-l details,-a including hidden files
2. Conversion directory
CD Example: Think of a drive directory to stroll around Cd/system/library/extensions
3. Create a new catalogue
mkdir Directory Name Example: Build a backup directory under the driver directory backup Mkdir/system/library/extensions/backup
Build a backup directory on the desktop back up mkdir/user/user name/desktop/backup
4. Copy files
CP parameter source file target file example: Want to copy the desktop Natit.kext to the driver directory cp-r/user/user name/desktop/natit.kext/system/library/extensions
The parameter R indicates a recursive operation of the directory, and Kext looks like a file under the graphical interface, which is actually a folder.
Back up all files in the drive directory to desktop backup
Cp-r/system/library/extensions/*/user/User name/desktop/backup
5. Delete Files
RM Parameter File example: Want to delete the driver's cache Rm-rf/system/library/extensions.kextcache Rm-rf/system/library/extensions.mkext
Parameter-RF is recursive and mandatory, be careful to use, if executed RM-RF/your system is gone
6. Moving files
MV File example: Want to move Applehda.kext to desktop mv/system/library/extensions/applehda.kext/user/user name/desktop
Want to move the Applehda.kext to the backup directory Mv/system/library/extensions/applehda.kext/system/library/extensions/backup
7. Text editing
Nano File name example: Edit Natit info.plist nano/system/library/extensions/natit.kext/info.plist
Ii. details of the order
1. Directory operation
Command name |
Function description |
Examples of Use |
Mkdir |
Create a Directory |
mkdir dirname |
RmDir |
Delete a directory |
RmDir dirname |
Mvdir |
Move or rename a directory |
Mvdir Dir1 Dir2 |
Cd |
Change the current directory |
CD dirname |
Pwd |
Displays the path name of the current directory |
Pwd |
Ls |
Display the contents of the current directory |
Ls-la |
2. File operation
Command name |
Function description |
Application examples |
Cat |
Show or connect files |
Cat filename |
Od |
Display the contents of a non-text file |
od-c filename |
Cp |
Copy a file or directory |
CP file1 File2 |
Rm |
Delete a file or directory |
RM filename |
Mv |
Change the file name or directory |
MV File1 File2 |
Find |
Finding files using matching expressions |
Find. -name "*.C"-print |
File |
Show file types |
File filename |
3. Select operation
Command name |
Function description |
Examples of Use |
Head |
Show the first few lines of a file |
head-20 filename |
Tail |
Display the last few lines of a file |
tail-15 filename |
Cut |
Display some fields in each row of a file |
Cut-f1,7-d:/etc/passwd |
Colrm |
Remove several columns from standard input |
COLRM 8 File2 |
Diff |
Compare and display the differences of two files |
diff File1 File2 |
Sort |
Sort or Merge files |
sort-d-f-u File1 |
Uniq |
Remove duplicate rows from a file |
Uniq file1 file2 |
Comm |
Public and non-public rows showing two ordered files |
Comm File1 File2 |
Wc |
The number of characters, words, and lines of a statistic file |
WC filename |
nl |
Add a line number to a file |
NL file1 >file2 |
Mac Common Terminal commands