资源预览内容
第1页 / 共40页
第2页 / 共40页
第3页 / 共40页
第4页 / 共40页
第5页 / 共40页
第6页 / 共40页
第7页 / 共40页
第8页 / 共40页
第9页 / 共40页
第10页 / 共40页
亲,该文档总共40页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
IWS (Instructional Work Servers),There are 4 instructional Unix servers: ceylon, fiji, sumatra, and tahiti Accessing the servers: Terminal Programs: telnet (insecure; cannot be used) ssh (via the TeraTerm or Putty programs from Windows) Start - Program Files - Desktop Tools - TeraTerm File Transfer Programs ftp (insecure; cannot be used at UW) from Start - Run menu e.g - fijizanfur Secure file transfer (from C&C) Xwindows Run xgo from the command prompt Come to the ACM tutorial!,This tutorial provided by UW ACM http:/www.cs.washington.edu/orgs/acm/ Questions to hctangcs, zanfurcs, awongcs,Logging In,Which server you use (almost) doesnt matter all four allow access to your files Although your Windows and Unix usernames (and passwords) are the same, they are two separate accounts Your z: drive is not your Unix account Connecting: Well connect to the Unix machines via ssh After connection, you are presented with a login prompt After logging in, youre placed in your home directory (where your personal files are located),The Command Prompt,Commands are the way to “do things” in Unix A command consists of a command name and options called “flags” Commands are typed at the command prompt In Unix, everything (including commands) is case-sensitive,prompt$ ,fiji:/u15/awong$ ls l -a unix-tutorial,Command Prompt,Command,(Optional) flags,(Optional) arguments,Note: In Unix, youre expected to know what youre doing. Manycommands will print a message only if something went wrong.,Two Essential Commands,The most useful commands youll ever learn: man (short for “manual”) info They help you find information about other commands man or info retrieves detailed information about man k searches the man page summaries (faster, and will probably give better results) man K searches the full text of the man pages,fiji:/u15/awong$ man k password passwd (5) - password file xlock (1) - Locks the local X display until a password is entered fiji:/u15/awong$ passwd,Directories,In Unix, files are grouped together in other files called directories, which are analogous to folders in Windows Directory paths are separated by a forward slash: / Example: /u10/hctang/classes/cse326 The hierarchical structure of directories (the directory tree) begins at a special directory called the root, or / Absolute paths start at / Example: /u10/hctang/classes/cse326 Relative paths start in the current directory Example: classes/cse326 (if youre currently in /u10/hctang) Your home directory is where your personal files are located, and where you start when you log in. Example: /u10/hctang,Directories (contd),Handy directories to know Your home directoryThe parent directory . The current directory ls LiSts the contents of a specified files or directories (or the current directory if no files are specified) Syntax: ls Example: ls backups pwd Print Working Directory,Directories (contd further),cd Change Directory (or your home directory if unspecified) Syntax: cd Examples: cd backups/unix-tutorial cd /class-notes mkdir MaKe DIRectory Syntax: mkdir Example: mkdir backups class-notes rmdir ReMove DIRectory, which must be empty Syntax: rmdir Example: rmdir backups class-notes,Files,Unlike Windows, in Unix file types (e.g. “executable files, ” “data files,” “text files”) are not determined by file extension (e.g. “foo.exe”, “foo.dat”, “foo.txt”) Thus, the file-manipulation commands are few and simple rm ReMoves a file, without a possibility of “undelete!” Syntax: rm Example: rm tutorial.txt backups/old.txt,Files (contd),cp CoPies a file, preserving the original Syntax: cp Example: cp tutorial.txt tutorial.txt.bak mv MoVes or renames a file, destroying the original Syntax: mv Examples: mv tutorial.txt tutorial.txt.bak mv tutorial.txt tutorial-slides.ppt backups/,Note: Both of these commands will over-write existing files without warning you!,Shell Shortcuts,Tab completion Type part of a file/directory name, hit , and the shell will finish as much of the name as it can Works if youre running tcsh or bash Command history Dont re-type previous commands use the up-arrow to access them Wildcards Special character(s) which can be expanded to match other file/directory names* Zero or more characters? Zero or one character Examples: ls *.txt rm may-?-notes.txt,Text - editing,Which text editor is “the best” is a holy war. Pick one and get comfortable with it. Three text editors you should be aware of: pico Comes with pine (Dantes email program) emacs/xemacs A heavily-featured editor commonly used in programming vim/vi A lighter editor, also used in programming Get familiar with one as soon as possible!,Text - printing,Printing: Use lpr to print Use h (no header) and Zduplex (double-sided) to save paper Check the print queue (including Windows print jobs!) with lpq lprm to remove print jobs (including Windows print jobs) For the above commands, youll need to specify the printer with P Check out enscript (quizlet: how do you find information about commands?) to print text files nicely! WARNING: Do NOT use enscript with postscript files! Check out the ACM webpage for a printing reference card!,
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号