Sei sulla pagina 1di 1

Mac-Friendly Terminal Cheat Sheet

Command History Text Shortcuts


history n ctrl-a
Shows the stuff you've typed - add a number to limit to
Jump to the start of the line.
the last n items.
ctrl-r ctrl-e
Jump to the end of the line.
Interactively search through previously typed commands.
!searchtext ctrl-k
Execute the last command typed that starts with Delete all text to the right of the cursor.
'searchtext'. ctrl-y
!! Paste text that you last deleted with these
Execute the last command you typed. commands.
command !* command !*
Execute 'command' with the same parameters used Execute 'command' with the same
previously. parameters used previously.

tab
Pressing tab will attempt to automatically complete the
command you've begun typing. Process Control
ctrl-d
Useful Commands Sends end of file, will stop some
processes that are waiting for an EOF.
top
Shows active processes. Press q to quit.
ctrl-z
Stops the currently running command.
sudo command
Run a command as super user - type in your password fg
when prompted. Continues running the stopped command.
open command kill PID
Opens a file as if you double clicked it.
Kills a process with an ID of 'PID'.
find -name filename | xargs grep text
For file names matching 'filename', search their contents killall name
for 'text'. Kills a process called 'name'.
screen ps aux
Amazingly useful screen manager: read the manual!
Lists active processes.

Emergencies Help Yourself


echo command
man command
This causes the terminal to print out 'command', showing
you expansions: Show the help for 'command'.
whatis command
g5:~ alex$ echo ls ~ $HOSTNAME Gives a one-line description of 'command'.
ls /Users/alex g5.local
apropos string
reset Search the whatis database for 'string'.
This resets the terminal's display, which is useful if it
becomes corrupted somehow.
http://alexyoung.org/terminal_cheat_sheet.pdf

Potrebbero piacerti anche