|Building on a Legacy of Excellence|
|Apply & Register|||||Schedules & Catalog|||||Instruction|||||For Students|||||Faculty & Staff|||||Administration|||||About SRJC|
Basic Unix Commands
The following commands are categorized by type or function. These are the minimum required to get you going; it is far from a complete list of all Unix commands.
Files on a UNIX system are grouped into directories and subdirectories in a
hierarchical structure. The use of a path statement is how files and
directories are accessed.
Back to command index
telnet 'telnet' connects to remote computer. At the $ prompt, type 'telnet hostname' where hostname is the remote computer. ftp 'ftp' connects to FTP site on remote computer and allows you to transfer files from your local machine to the remote computer or vice versa. The syntax for 'ftp' is the same as for 'telnet'; 'ftp hostname'. pine 'pine' initiates pine e-mail reader. elm 'elm' initiates elm e-mail reader. logout 'logout' terminates connection to remote system. (Can also use 'bye').
NOTE that when using the computer labs on campus, check with a lab assistant for specific applications that can be used for connecting to, and transferring files to and from other systems.
date 'date' displays the current date and time. who 'who' displays a list of users who are currently logged in. finger 'finger' is similar to 'who', but displays more information, i.e. user name, login time, login location. ps 'ps' displays a list of the processes (programs) that you are currently running. talk 'talk' enables logged-in users to have a conversation over the network. To initiate a conversation, type the command 'talk loginname'. The conversation can be terminated by either party by typing the interrupt character ^C (hold down the CTRL key and press the letter c).Back to command index
Vi is the default editor for the "elm" mail reader. It is a good idea to familiarize yourself with vi before attempting to use elm. For a mail reader with a menu-driven interface, use pine.
Opening and Exiting Commands
vi Invokes vi with blank editing screen (new file) in command mode. vi filename Invokes vi on existing file. :w Writes (saves) existing file (command mode only; <ESC> from insert mode). :w filename Writes (saves) to new file (command mode only; <ESC> from insert mode). :x Writes (saves) file and exits vi (command mode only; <ESC> from insert mode). :q Quits vi without saving (command mode only; <ESC> from insert mode). :q! Quits vi without saving any changes to file (command mode only; <ESC> from insert mode).
h Move cursor left one character. j Move cursor down one line. k Move cursor up one line. l Move cursor right one character. w Move cursor forward one word. b Move cursor backward one word. e Move cursor to end of word. ^F Move cursor forward one screenful.(Hold CTRL key and press f) ^B Move cursor back one screenful. (Hold CTRL key and press b) ^D Move cursor down half screenful. (Hold CTRL key and press d) ^U Move cursor up half screenful. (Hold CTRL key and press u)
i Insert mode; inserts text before current cursor position. I Insert mode; inserts text at the beginning of the line. a Insert mode; append text following cursor position. A Insert mode; append text at the end of the line. o Open a new line below the current line and insert text. O Open a new line above the current line and insert text. r Replace character under cursor. R Overtype mode; <ESC> terminates overtype. s Substitute following text for character at cursor position; <ESC> terminates text entry mode. S Substitute text on entire line. <ESC> Return to visual command mode from insert mode. x Delete character at cursor position. X Delete character before cursor. dw Delete word at cursor position. dd Delete current line. d$ Delete from cursor to end of line. d^ Delete from cursor to beginning of line. cx Change text object at cursor positon. x is a cursor movement key, commonly c (line), w (word), b (back one word), $ (to end of line), ^ (to beginning of line). <ESC> terminates text entry mode. ym Yank (copy) text block identified by movement command m. (See above) Y Yank (copy) current line. p Put yanked text after or below cursor. P Put yanked text before or above cursor. . Repeat last edit. u Undo last edit. U Restore current line.NOTE that is it important to type carefully when using vi. Since vi commands are case sensitive, you DO NOT want to accidentally turn Caps Lock on. You will get unexpected results.
Santa Rosa Junior College is officially accredited by the Western Association of Schools and Colleges