Mac OSX shortcut key--Go

Source: Internet
Author: User
Tags clear screen dbx diff disk usage

1. Useful commands: http://www.mitchchn.me/2014/os-x-terminal/

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:

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:

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 Common Commands--------------------

Apple Mac OS X operating system, hidden files are shown there are many ways to set, the simplest to count on the Mac Terminal Input command. The show/Hide Mac hidden files command is as follows (note the spaces and case-sensitive):
command to display Mac hidden files: Defaults write Com.apple.finder appleshowallfiles-bool true
command to hide Mac hidden files: Defaults write Com.apple.finder Appleshowallfiles-bool false
Or
command to display Mac hidden files: Defaults write Com.apple.finder appleshowallfiles YES
command to hide Mac hidden files: Defaults write Com.apple.finder appleshowallfiles NO
After you lose, click Enter, exit the terminal, and restart the finder.
Restart Finder: Mouse click the Apple flag in the upper-left corner of the window and force exit-->finder--> restart

Mac OS X terminal shortcut key: cammand+k (Clear actually no bird)
Linux system Clear Screen shortcut key: ctrl+l (reset)
Windows command line Clear command: CLS
OS X uses UNIX file systems, all files are hung in the root directory/below, so there is no longer a drive letter concept under Windows.
The hard drives you see on the desktop are hung under/volumes.
For example, after a mobile drive called USBHD, the desktop will show a hard disk icon, where is it actually?
Execute LS/VOLUMES/USBHD in the terminal to see if the contents of this mobile drive are displayed.
root directory location is/core Mach_kernel right here,
Drive Location/systme/library/extensions
User folder location/user/user name
The location of the desktop/user/user name/desktop

File wildcard character Asterisk *
Note: In UNIX systems, there is a difference between uppercase and lowercase characters, and A.txt is not equal to a.txt.
Root flag/Not dispensable, cd/system means to go to the system under the directory, and the CD system means to go to the system in the current directory
——————————————————————————————————————————————
How to enter command line operation mode
In the graphical interface, open the Application utility terminal with the Finder
If even the graphical interface can not be entered (such as the wrong display driver), when the boot press F8, start with the-s parameter, and then enter the command MOUNT-UW/
Get permission
In order to prevent misoperation to destroy the system, then the user state when there is no permission operating system important files, so first to get root permissions
Sudo-s
Then enter the password, enter the password without any echo, even the asterisk is not, just lose the return on the line.
——————————————————————————————————————————————
List files
LS parameter directory name
Example: Want to see what is in the directory,
LS/
Want to see what's in the drive directory,
Ls/system/library/extensions
Parameter-W displays Chinese,-l details,-a including hidden files
Converting catalogs
Cd
Example: Think of a drive directory to stroll around
Cd/system/library/extensions
Create a new directory
mkdir Directory Name
Example: Create a backup directory in the driver directory
Mkdir/system/library/extensions/backup
Build a backup directory on the desktop back up
mkdir/user/User name/desktop/backup

Copy files
CP parameter source file destination file
Example: Want to copy the desktop Natit.kext to the drive 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

deleting files
RM parameter file (RM-RF folder)
Example: To delete a 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

Moving files
MV File
Example: Want to move Applehda.kext to the 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

Change file permissions
chmod parameter permission file (#add ch represents change)
Example: Set all files in the drive directory to root read/write, other users read only
Chmod-r 755/system/library/extensions
The parameter R is recursive, and 755 represents the permissions of each user

Change file Owner
Chown parameter User: Group file
Example: Change all the files in the drive directory to the root user
Chown-r root:wheel/system/library/extensions
Parameter r indicates a recursive operation

Fix permissions on files throughout the system
Diskutil repairpermissions/
Strictly speaking, this is not a Unix command, but OSX is a software that remembers the modification or addition of the driver to execute once.
Text editing
Nano file name
Example: Edit Natit info.plist
Nano/system/library/extensions/natit.kext/info.plist
After editing, use Ctrl +o to save, ctrl+x exit
Another text editing software is VI, the operation is a bit odd, cooked is very useful, and in all Unix-like systems, it is not afraid to go all over the world.
Run script command
SH Script file name
Example to modify the driver after all the required operations into a script, after the driver has been modified to run once this script is OK, convenient
1. Running Nano/clean in 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. Ctrl +o disk, ctrl+x exit
4. Once the driver is moved, run it once in the terminal Sh/clean
————————————————————————————————————
Little Tricks
Use the Tab key to auto-complement commands
For example, think of the/system directory, enter the Cd/sy and then press the TAB key, the command will automatically fill into equal Cd/system
Manipulate files and directories with spaces in the name
Spaces are written in the command, for example, to enter My Documents, the command is CD My Documents
View detailed help for a command
Man command name (#add manual)
For example, to see the detailed use of the LS command, execute the man ls
————————————————————————————————————
Typical Operating Procedures
Suppose you download a video card driver Natit.zip, the desktop decompression to get a natit.kext, how to do it?
For the sake of insurance, back up all the drivers first.
mkdir/user/User name/desktop/backup Create a backup folder on the desktop
Cp-r/system/library/extensions/*/user/User name/desktop/backup backup driver file
Now you can install it safely.
Cp-r/user/user name/desktop/natit.kext/system/library/extensions copy it to the system-driven directory location
Sh/clean Execute cleanup Script, Operation complete
Re-boot failed, into the desktop, found that should not be the driver, how to recover it?
Power on F8, start with-s parameter
Execute MOUNT-UW/
rm-rf/user/User name/desktop/natit.kext Delete this driver
Sh/clean Execute cleanup Script, Operation complete
Restart, back to the original state, do not forget Ah, no special effects how to do it, and heard the need to modify the Natit Info. plist file is fine.
Cp-r/user/user name/desktop/natit.kext/system/library/extensions copy it to the system-driven directory location
Nano/system/library/extensions/natit.kext/info.plist
After editing, use Ctrl +o to save, ctrl+x exit
Sh/clean Execute cleanup Script, Operation complete

Restart, this time, the Carter effect has been, the sound card, God knows what will happen, we have to protect the existing results.
mkdir/user/User name/desktop/gooddrivers to create a directory for valid drivers
Cp-r/system/library/extensions/natit.kext/user/user name/desktop/gooddrivers backup
This sound card requires Applehda.kext to delete and edit the Appleazaliaaudio.kext in the Info.plist file, who knows later will not still use AppleHDA it, rather temporarily disable it.
mkdir/system/library/extensions/disabled Creating a disabled directory
Mv/system/library/extensions/applehda.kext/system/library/extensions/disabled move Past
Nano/system/library/extensions/natit.kext/appleazaliaaudio.kext/info.plist
After editing, use Ctrl +o to save, ctrl+x exit
Sh/clean Execute cleanup Script, Operation complete
Successful, also the modified driver back up the copy content to the Clipboard code:
The following is the UNIX command line, for reference
Directory Operations:
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

dircmp
Compare the contents of two directories
DIRCMP Dir1 Dir2
File operation:
Cat
Show or connect files
Cat filename

Pg
Paging formatted display of file contents
PG filename

More
Split-screen display of file contents
More 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

ln
Join file
Ln-s file1 file2

Find
Finding files using matching expressions
Find. -name "*.C"-print

File
Show file types
File filename
Select action:
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

Paste
Cross-connect files
Paste File1 file2

Diff
Compare and display the differences of two files
diff File1 File2

Sed
Non-interactive mode flow editor
Sed "s/red/green/g" filename

Grep
Find in Files by pattern
grep "^[a-za-z]" filename

Awk
Find and manipulate patterns in files
awk ' {print '} ' filename

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
Safe operation:
passwd
Modify User Password
passwd

chmod
Change permissions for a file or directory
chmod ug+x filename

Umask
Define a permission mask to create a file
Umask 027

Chown
Change the owner of a file or directory
Chown newowner filename

Chgrp
Change the owning group of a file or directory
CHGRP staff filename

Xlock
To lock the terminal
Xlock-remote
Programming Operations:
Make
Maintaining the latest version of an executable program
Make

Touch
Update file access and modification times
Touch-m 05202400 filename

Dbx
Command line interface Debugging Tools
DBX a.out

Xde
Graphical user interface Debugging Tools
Xde a.out
Process actions:
Ps
Show the current status of the process
PS u

Kill
Terminating a process
Kill-9 30142

Nice
Change the priority of the pending command
Nice cc-c *.c

Renice
Change the priority of a running process
Renice +20 32768
Time Operation:
Date
Displays the current date and time of the system
Date

Aa.
Show Calendar
Cal 8 1996

Time
Execution time of the statistical program
Time A.out
Network and communication operations:
Telnet
Telnet
Telnet hpc.sp.net.edu.cn

Rlogin
Telnet
Rlogin hostname-l username

Ts.
Execute the specified command on the remote host
RSH f01n03 Date

Ftp
Transferring files between a local host and a remote host
FTP ftp.sp.net.edu.cn

Rcp
Copying files between a local host and a remote host
rcp file1 host1:file2

Ping
Send a response request to a network host
Ping hpc.sp.net.edu.cn

Mai
Read and send e-mail
Mail

Write
Send a message to another user
Write username PTS/1

Mesg
Allow or deny receiving of messages
MESG N

Korn shell command
History
List several recently executed commands and numbers
History

R
Repeatedly executes a command that has been recently executed
R-2

Alias
To define an alias for a command
Alias Del=rm-i

Unalias
To cancel the definition of an alias
Unalias del

Other commands:
Uname
Displays information about the operating system
Uname-a

Clear
Clear screen or window contents
Clear

Env
Show all currently set environment variables
Env

W.H.O.
List all users who are currently logged on
W.H.O.

WhoAmI
Displays the user name that is currently in action
WhoAmI

Tty
Displays the name of the terminal or pseudo terminal
Tty

Stty
Display or reset control key definitions
Stty-a

Du
Querying disk usage
Du-k SubDir

Df
Displays the total and free space of the file system
Df/tmp

W
Displays the total information for the current system activity
W

Mac OSX shortcut key--Go

Related Article

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.