Mac OSX Shortcuts & command line

Source: Internet
Author: User
Tags diff disk usage

I. MAC OSX shortcut keys

Ctrl+shift                               &NB Sp     Quick Zoom dock icon will zoom in temporarily, and if you turn on dock Zoom
Command+option+w                 Close all Windows
Command+w                             the current Window close (Can Close Safari tab bar, very useful)  
Command+option+m                 Minimize All windows &NBSP
Command+q                             Close the current Application (equivalent to dock right mouse button launch. Very practical)  
Command+m                       &N Bsp     Minimize the currently used window  
command+h                             Hide current window or software

Command+tab                         To switch the current task  
Cont Rol+command+s               Toggle control bar Display and hide
command+i                               General information (display and set icon properties)  
Command+delete   &NBSP ;                 move to Trash (delete)  
optionion+ mouse                       Drag images or folders to copy images or folders to other folders instead of moving
Command+shift+backspace   & nbsp Empty the Trash (plus option Press to skip Confirmation dialog box)
Command+n                       &NBS P     Key to create a new folder "return" or "enter" or "O" key to open the selected item
Command+option+esc             Key can be forced to quit the dead program  

Command+shift+3 (current screen)
Command+shift+4 (free selection range)
OPTION+F12 shutdown window (option to shut down, restart, sleep)
Command+1 Display As Icon
COMMAND+2 Display in column mode
Command+3 displayed in list mode
Command+4 is displayed as cover Flow mode
Return or enter key to edit the name of the selected image or folder

Two. Mac OSX command line:

Basic commands
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

Directory Operations:
Command name function Description Use example


mkdir Create a directory mkdir dirname
RmDir Delete a directory rmdir dirname
Mvdir move or rename a directory Mvdir Dir1 Dir2

CD Change current directory CD DirName
PWD Displays the path name of the current directory pwd
LS Displays the contents of the current directory Ls-la

File operation:
Command name function Description Use example

Cat display or connection file cat filename
OD Displays the contents of non-text files od-c filename
CP Copy files or directories CP file1 file2

RM Delete file or directory RM filename
MV Change the file name or the directory in which MV File1 file2
Find finds files using matching expressions. -name "*.C"-print
File display files of type filename

Select action:
Command name function Description Use example

Head displays the first few lines of the file head-20 filename
Tail display the last few lines of a file tail-15 filename
Cut displays some fields in each line of the file cut-f1,7-d:/etc/passwd
COLRM remove several columns from standard input COLRM 8 file2

Diff compares and displays the difference of two files diff file1 File2
Sort or merge files sort-d-f-u file1
Uniq remove duplicate lines from the file Uniq file1 file2
Comm displays both public and non-public rows of two ordered files comm file1 file2
Number of characters, number of words, and number of lines in WC statistics file WC filename
NL adds line number to file NL file1 >file2

Process actions:
Command name function Description Use example

PS Display process Current state PS U
Kill terminates the process kill-9 30142

Time Operation:
Command name function Description Use example

Date Displays the current date and time of the system.
Cal Display Calendar cal 8 1996
Time of execution of the statistics program a.out

Network and communication operations:
Command name function Description Use example

Telnet telnet hpc.sp.net.edu.cn
Rlogin telnet rlogin hostname-l username
RSH executes the specified command on the remote host rsh f01n03 date

FTP transfers files between the local host and the remote host ftpftp.sp.net.edu.cn
rcp copying files between the local host and the 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
Write sends a message to another user write username pts/1
MESG allow or deny receive messages MESG N


Korn shell command:
Command name function Description Use example

History lists several recently executed commands and numbering history
R repeatedly executes a command that has recently been executed r-2
Alias defines aliases for a command del=rm-i
Unalias to cancel the definition of an alias Unalias del

Other commands
Command name function Description Use example

Uname displays information about the operating system uname-a
Clear clears the screen or window contents clear
ENV displays all currently set environment variables env
Who lists all users currently logged on who
WHOAMI Displays the user name that is currently being manipulated WhoAmI
TTY displays the name of the terminal or pseudo-terminal TTY
Stty display or reset the control key definition Stty-a
Du query disk usage du-k subdir
DF/TMP Displays the total and free space of the file system
W Displays the total information for the current system activity

Mac Delete all the. svn files in the folder
Directly inside the terminal, execute the command (it seems that the directory name cannot contain spaces):
sudo find/users/cundong/documents/source-name ". SVN"-exec rm-r {} \;
Get the files out of the phone.
ADB pull/sdcard/360download/source.apk/users/cundong/desktop/target.apk
Push files from your Mac to your phone
ADB push/users/cundong/desktop/source.apk/sdcard/360download/target.apk

Anti-compilation apk in Java file
1). Unzip the apk to get classes.dex;
2). Download Dex2jar http://code.google.com/p/dex2jar/
Extract
Give permission chmod +x dex2jar.sh
Run./dex2jar.sh/users/cundong/desktop/xxxx.apk
3). Download Jd-gui can be opened directly to see. http://java.decompiler.free.fr/


Mac OSX Shortcuts & command line

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.