How to Get Out
Elizabeth (Betsy) Aoki
Sometimes the best thing to know is when to leave, and how. Here are a few commands and tricks that will help you get out of things in Linux.
Note: none of these commands actually use single quotation marks - these quote marks are used to set the word off in the instructions. The control key is often to the lower left on your keyboard, near the option key.
In the command line:
Control-c or hitting the Delete Key will interrupt commands you hit return already for
Control-u erase the command line and start over
Control-h or backspace functions like you think it will
Control-z will interrupt a currently running program and suspend it until you resume it. Better than using ps and kill for processes/jobs you want killed dead, if you actually want it to start up again.
While in the manual pages
Ever realize that the man pages just don't have as much instruction as you'd like them to?
Hit f key to advance a page, b key to go back.
Hit q to get out of the man pages and back to the command line
Escaping from one of the editors
(In vi )
hit escape key (ESC) to get into command mode and out of your text
Assuming you are in command mode and not insert mode, type one of these.
:w saves yer file
:wq best command - gets you out and saves
:q gets you out of vi, if you have not made any changes
:q! (colon shift-q and exclamation point) gets you out without saving any changes, boots you out immediately
ZZ (shift and z key twice) saves and kicks you out after
Typing in either a or I (in vi - Meryll)
will get you into editing mode again (insert)
(Emacs) (I think Betsy might be confusing Emacs with Pico - Meryll)
Control-x and Control-C gets you out
Control-x, then hitting Control-s saves file to disk
Control-h> or the F1 key often gets you help
Call the whole thing off.
To get rid of a command or program you already started but realize it's a nightmare (think of the task manager in windows, only more satisfying):
- Type ps to get the process ID, hit return
- Type the command kill , a space. and the process ID number after the space
Example: kill 547
You can also
- Type in the command jobs to get the user job number.
- Type kill space, the percent sign (%) and then the user job number,
Example: kill %4
To get out of Linux and shut the computer down from the command line, type in:
halt now
- Or you can type:
shutdown -h now
This safely turns off the computer and shuts everything down for the night.