Professional Documents
Culture Documents
1.1 Essential Linux Commands
1.1 Essential Linux Commands
To learn more about a particular command, view the manual page associated with it - simply type man followed by the name of the command you want to learn about. To exit from a manual page, press the q key (where q stands for quit). Most commands have options associated with them - dont try to guess the options ... read the manual page!
Printing Commands
lpq lpr lprm check the status of your entries on the print queue add an entry to the print queue remove an entry from the print queue
Networking Commands
netstat ping traceroute show the network status for this system is there anybody out there? Check a host for existence show me how to get from here to there
Miscellaneous Commands
cal clear date echo man passwd perl su telnet uname users vi whereis which who whoami Ctrl-D display a calendar on the screen clear the screen display the current date and time on the screen display a message on the screen read a manual page (type man man to learn more) change your password run Perl (a great programming language . . . ) create a shell under the ID of some other user log into a remote computer display the machine and operating system name list the current login sessions on the system run vi (a great text editor . . . ) locate a binary (executable), source, or manual page disk-le list the path to a particular binary disk-le (executable) who is currently logged in cause Ive forgotten . . . signal end-of-le to running process (key combination)
1.2
vi Quick Reference
This quick reference will get you started. To learn more, from the Linux command-line, type: man vi.
vis modes
vi can be in one of three modes: edit mode - keys typed are added to the edit buer non-edit mode - keys typed adjust or move around the edit buer ex mode - commands are executed within vi, and the commands aect the edit buer To enter edit mode, press the Esc key then type i To enter non-edit mode, simply press Esc To enter ex mode, press Esc then type :
insert blank line below current one, enter edit mode insert blank line above current one, enter edit mode enter edit mode by inserting text at current location enter edit mode by appending text after current location enter edit mode by appending to the end of the current line 4
J Ctrl-G nG G
join the current line with that line immediately below it show current line number go to line n within the edit buer go to bottom of edit buer
temporarily exit vi to access a Linux shell access the vi on-line help access the on-line help for subject cmd used to set and unset vi settings display the entire list of vis current settings
Searching
/pattern / ?pattern ? n search forward in edit buer for a match to pattern repeat last forward search search backward in edit buer for a match to pattern repeat last backward search repeat previous search (regardless of direction)