Mac basic commands

Source: Internet
Author: User
Tags clear screen file type file

Mac basic commands Daquan basic commands 1. list file ls parameter directory name example: see what is in the driver Directory: ls/System/Library/Extensions parameter-w display Chinese, -l detailed information,-a includes hidden files 2. Conversion directory cd example: Think of a drive directory to slide a circle cd/System/Library/Extensions 3. Create a new directory mkdir directory name 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/username/Desktop/backup 4. copy the file cp parameters. source File target file example: 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 For recursive operations, kext looks like a file in the graphic interface, actually a folder. Back up all files in the driver directory to the Desktop backupcp-R/System/Library/Extensions/*/User name/Desktop/backup 5. delete the file rm parameter file example: you want to delete the driver's 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 rm-rf is executed, your system will be completely deprecated. 6. Move the file mv file example: You want to put 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 7. Edit the nano file name in the Text Example: Edit natit Info. plist nano/System/Library/Extensions/Natit. kext/Info. plist directory operation command name function description use example mkdir to 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 display the current directory path Name pwd ls show the content of the current directory ls-la file operation command name function description use example cat display or connection file cat filename od show non-text file content od-c filename cp copy file or directory cp file1 file2 rm delete file or directory rm filename mv change file name or directory mv file1 file2 find use matching expression to find the file. -name "*. c "-print file display file type file filename Select Operation Command name function description use example head to display the first few lines of the file head-20 filename tail display the last few lines of the file tail-15 filename cut: show certain fields in each line of the file cut-f1, 7-d: /etc/passwd colrm delete several columns from standard input colrm 8 20 file2 diff comparison and display the differences between two files diff file1 file2 sort or merge files sort-d-f-u file1 uniq remove duplicate lines in the file uniq file1 file2 comm show the number of characters, number of words, and number of lines in the public and non-public lines of the two ordered files comm file1 file2 wc statistics file wc filename nl add row numbers to the file nl file1> file2 Process Operation Command name function description use example ps display process current state ps u kill stop process kill-9 30142 Time Operation Command name function description use example date display system current date and time date cal display calendar cal 8 1996 time statistical program execution time. for example, telnet to remotely log on to telnet hpc.sp.net.edu.cn rlogin to remotely log on to rlogin hostname-l username rsh on the remote host and run the specified command rsh f01n03 date ftp on the local host and remotely transfer files between hosts ftpftp.sp.net.edu.cn rcp copy files between the local host and remote host rcp file1 host1: file2 ping sends a Response Request to a network host ping hpc.sp.net.edu.cn mail read and send email mail write to another user send message write username pts/1 mesg allow or reject receiving message mesg n Korn Shell command command name function description use the example history to list several recently executed commands and number history r to repeatedly execute a recently executed command r-2 alias to define an alias for a command alias del = rm-I unalias cancel definition of an alias unalias del other command name function description use example uname show information about the operating system uname-a clear screen or window content clear env display all currently set environment variables env who list all users currently logged on who whoami Display User Name currently in operation whoami tty display terminal or Pseudo Terminal Name tty stty display or reset control key definition stty-a du query disk usage du-k subdirdf/tmp display total space and available space of the file system w display total information of the current system activity

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.