Apple Mac OS System shell command Daquan Introduction

Source: Internet
Author: User

Basic command 1, list file ls parameter directory name         Example: see what's in the driver directory: ls/system/library/extensions parameter-w display Chinese,-l details,-a including hidden file 2, turn Change directory      CD     Example: Think of a drive directory to stroll around   cd/system/library/extensions 3, create a new directory mkdir directory name & nbsp   Example: Build a backup directory under the drive directory backup     MKDIR/SYSTEM/LIBRARY/EXTENSIONS/BACKUP build a backup directory on the desktop back up catalog backup     mkdir/user/user name/desktop/backup 4, copy file CP parameter source file target file     example: Want to copy the Natit.kext of the desktop to the driver directory  cp-r/user/user name/ The Desktop/natit.kext/system/library/extensions 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 the desktop Backupcp-r/system/library/extensions/*/user/username/desktop/backup 5, delete file rm parameter file   Example: To delete a driver's cache  rm-rf/system/library/extensions.kextcache     rm-rf/system/library/ Extensions.mkext parameter-rf means recursive and mandatory, be careful to use, if executed RM-RF/your system is all gone  6, move file mv File   example: Want to move Applehda.kext to the desktop   &NBSP ; mv/system/library/extensions/applehda.kext/user/user name/desktop want to move 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  directory operations   command name                       function description                   &NBSP ;                         Use example  mkdir       & nbsp                 Create a directory                 &NBS P                     mkdir dirname rmdir                         Delete a directory                 &N Bsp                     rmdir dirname mvdir                        Move or rename a directory                         Mvdir Dir1 dir2 cd                             Change current directory                               &NB Sp       CD dirname pwd                       &NBS P   Show path name of current directory                          pwd ls &NB Sp                           Show content of current directory     & nbsp                       ls-la    file operations   command name                               &nbsp   function Description   ;                              CAT   Use example   &NBS P                                   display or even File                       Cat filename    &nbsp : od                                       Display the contents of non-text files            od-c FILENAME CP         &NBS P                             Copy files or directories     &NB Sp                  CP file1 file2 rm           &N Bsp                         Delete files or directories         &N Bsp &nBsp             RM filename mv                 &NBS P                   Change file name or directory               MV File1 file2   find                         (+) nbsp         Find files using matching expressions             find. -name "*.C"-print file                           &N Bsp       Show file types                           &NBS P    file filename  Select action   command name                             Function description                           &NBS P           Use examples  head                               Show text First few lines of the piece                       head-20 filename tail   &NB Sp                           show the last few lines of the file                       tail-15 filename cut         &NBS P                       show files in each row of some fields                 cut-f1,7-d:/etc/passwd colrm                             remove several columns from standard input                  COLRM 8 fil E2   diff                          /      ratioDiff and show two file differences                diff file1 file2     sort &NB Sp                           Sort or merge files       &N Bsp                              sort-d-f-u file 1 uniq                           eliminate duplicate lines in a file   &N Bsp                              uniq file1 FILE2&N Bsp;comm                         show both public and non-public lines of two ordered documents              comm file1 FILE2 WC                             Statistics file characters, words and lines                    WC F Ilename&nbsP;NL                             To add line numbers   &nbs P                          ,         &NB Sp NL file1 >file2          Process Operations   command name                     function description                     &NBSP ;                           Use example  ps     &NBS P                     show the current status of the process             & nbsp                       PS U kill         &N Bsp               End-of-process                   &NBSP ;                                kill-9 30142&nbs p;     time Action   command name                       &NBSP ;   Function Description                               &NBSP ;             Use examples  date                   &NB SP; display the current date and time of the system                           Date cal & nbsp                           &nbsp     Show Calendar ;                          ,         &NB Sp Cal 8 1996 time                         The execution time of the statistical program     &nbsp                      time a.out  Network and Communication Operations   command name                                 function description     &NBSP ;                                 Use example   Telnet                                 &NB SP, remote login                                 TE Lnet hpc.sp.net.edu.cn rlogin                         &NB Sp       telnet                           &NBSP ;     Rlogin hostname-l username rsh                     & nbsp In the remote masterMachine Execution Command                             F01N03 rsh date& Nbsp;ftp                   to transfer files between localhost and remote host         &NBSP ;      FTPFTP.SP.NET.EDU.CN RCP                 to copy the text between the local host and the remote host Parts               RCP file1 host1:file2 ping           &NBS P       Send a response request to a web host                   Ping hpc.sp.net.edu.cn& Nbsp;mail                           review and email   &NBSP ;                          ,         &NB Sp  mail write                       to send a message to another user                                  write username PTS/1 MESG                     Allow or deny receive messages             & nbsp                              /    MES G N korn shell command                 command name                                 function description           &NBSP ;                             Use example  history               list recently executed commands and numbers                       History r                         re-executed recently executed One of the commands   &NBsp                        r-2 alias       &N Bsp                     Define an alias for a command             & nbsp                    alias del=rm-i unalias       &NB Sp             Cancel the definition of an alias                                  unalias del  other commands   command name                                   function description                                         Use example  uname                     Show operating system Information             &NBSP ; &nBsp              uname-a clear               &NBSP ;       Clear screen or window content                                        clear env                 &NB Sp       Show all currently set environment variables                         ENV  who                       List all users currently logged in       &N Bsp                            who whoami   &N Bsp               Show user name currently in action                 &NBS P            whoami tty                   &NBsp     Display terminal or pseudo-terminal name                           &NBSP ;             Tty stty                   &NB Sp     Display or reset control key definition                                        STTY-A DU                 and nbsp               Query disk usage                   &N Bsp     Du-k subdirdf/tmp                         &NBS p; Show file system total space and free space  w                                 Show total information for current system activity

Apple Mac OS System shell command Daquan introduction

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.