?? http:^^www.cs.washington.edu^education^courses^341^spring96^help^unix.html
字號:
Date: Wed, 08 Jan 1997 21:31:20 GMTServer: NCSA/1.4.2Content-type: text/html<html><head><title>Using UNIX</title></head><body><h1>Using UNIX</h1><h2>a brief introduction</h2><hr><b>Executive Summary:</b> <i>This document is designed to help you getstarted on UNIX. It assumes that you're not completely stupid aboutfiles and directories and such. It will only tell you the very mostbasic-est things.</i><hr><h3>Introduction to UNIX</h3>UNIX is an operating system. It likes to use short two-lettercommands for most things. When you ask it to do stuff, it doesn'tusually prompt you to make sure you're sure. It also doesn't printmuch back at you unless there's an error.<p>Most UNIX commands take arguments which are specified after thecommand -- often with a "-".<p><h3>File basics</h3>The current directory is called "." The parent directory is referredto as ".." Your home directory can be referred to using "~". Theroot directory in UNIX is simply called "/". Files can be specifiedusing slashes between directory names. For example, I can refer to afile named foo in my home directory as "~/foo".<p>Paths that start with "~" or "/" are absolute pathnames because theyrefer to a specific starting point. Other paths are relative, andconstructed starting from the directory you're in. The example abovewas absolute and will work no matter where I am. In contrast,"../foo" will go back one level from the current directory and lookfor foo. Here are some useful commands:<p><BLOCKQUOTE><DL><DT> <b>pwd</b><DD> prints the working directory you're in.<p><DT> <b>cd <i>name</i> </b><DD> changes you into the the named directory.<DT> <b>ls</b> <DD> lists the files in the current directory. Subdirectoriesare marked with a "/". <b>ls -l</b> gives you the long versionincluding the dates the files were created, their sizes, andplenty of other stuff that won't be important. <b>ls -a</b> lists allthe files in a directory. Filenames which start with "." are notprinted otherwise. <b>ls <i>name</i></b> lists the contents of thenamed directory. <DT> <b>cp <i>name</i> <i>new-name</i></b><DD> copies a file to a new name or location.<DT> <b>mv <i>name</i> <i>new-name</i></b><DD> moves a file. If new-name is adirectory, the file will be moved to that location. If it is afilename, it will be renamed to that name.<DT> <b>rm <i>name</i></b><DD> removes a file (<b>No warning!</b>).<DT> <b>mkdir <i>name</i></b><DD> makes a new directory.<DT> <b>rmdir <i>name</i> </b><DD> removes a directory.</DL></BLOCKQUOTE><h3>Looking at files</h3>The best way to look at a file (short of firing up an emacs session),is to use <b>more</b>. This will display the file one screenful at atime. Between screens, you can hit <b>q</b> to quit, <b>RETURN</b> toadvance one line, or <b>SPACE</b> to advance to the next screen. Youcan also search for text using <b>/<i>text</i>-RETURN</b>.<p><h3>Using the shell</h3>The shell is the command interpreter that you interact with in anxterm. On the mscc machines, you'll be using a shell called tcsh.You can re-run the previous command using <b>!!</b>. You can re-run acommand starting with a particular substring using<b>!<i>substring</i></b>. You can see a list of the recent commandsyou've typed using <b>history</b><p>You can also re-edit previous commands by using the arrow keys toscroll through them. The MSCC machines seem to be set up in such away that this isn't completely straightforward. Type <b>bindemacs</b> to make it work intuitively. Put this line in your .cshrcto have it be run automatically for you at every login (.cshrccontains commands that will be run whenever a new shell isstarted).<p><h3>On-line help</h3>On UNIX, every command has an on-line manual entry, which is a veryterse but complete description of what it does. Access these entriesby typing <b>man <i>command</i></b>. You can also use <b>apropos<i>substring</i></b> to get a list of commands which contain a givensubstring.<p><h3>Telnet/rlogin</h3>You can get access to other UNIX machines remotely using <b>telnet<i>machine</i></b> or <b>rlogin <i>machine</i></b>. For example, toaccess your MSCC account from a departmental machine, you would use<b>rlogin mscc.ms</b>. In this way, you'll never have to leave thecomfort of Sieg Hall. If your user name is different on the MSCCcluster, you can use <b>-l <i>username</i></b> to specify what yourname is there.<p><h3>Printing</h3>To print text files in UNIX, use enscript. Specify the printer withthe -P flag, and use -2r to save paper. I also use -G to get the"gaudy graphical" look.<h3>Conclusion</h3>Those are the most basic basics. This should tell you what you needto know to get through these assignments. For the most part, youshould be working within emacs, which has been documented elsewhere. Feelfree to ask questions if you have questions about UNIX that aren'tcovered here.<hr><address>Shamelessly stolen from cse341 Winter '96 <P>cse341-webmaster@cs.washington.edu</i>(Last update: <!-- see man strftime for full formatting options--> 03/22/96 at 02PM)<i></address></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -