1 / 46

Chapter 2 UNIX for Users

Chapter 2 UNIX for Users. Contents. Basic things in Unix login, logout, password, online manual X-window file system commands for files and directories file attributes editor. Login and Logout. Login account you already have one account in cs.sookmyung.ac.kr Login telnet X-window

sstone
Télécharger la présentation

Chapter 2 UNIX for Users

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 UNIX for Users

  2. Contents • Basic things in Unix • login, logout, password, online manual • X-window • file system • commands for files and directories • file attributes • editor

  3. Login and Logout • Login account • you already have one accountin cs.sookmyung.ac.kr • Login • telnet • X-window • Logout • Ctrl-D • logout

  4. Login • Systems you can use • cs.sookmyung.ac.kr • cslinux2.sookmyung.ac.kr • cslinux3.sookmyung.ac.kr • Telnet • telnet cs.sookmyung.ac.kr • Modem • Hyperterminal, 새롬데이터맨 : 710-9251 • 전화접속 네트워킹 : 3211-5656 • telnet, ftp, netscape, …

  5. X-window • X-window • developed at MIT • window system based on client/server model • standard window system for UNIX and Linux • X-window의 종류 • X11 by MIT • OpenWin on Sun Solaris, HP/UX, IBM AIX, ... • X11R6 on Linux

  6. Login to X-window • On Unix or Linux Console • login and • startx on Linux • openwin on Solaris • On Window PC • Xmanager on PC • X-window on Window95/98 • http://www.netsarang.co.kr

  7. X-window의 윈도우 매니저 • 윈도우 매니저의 역할 • 스크린에 나타나는 윈도우를 조정하고 관리한다. • 윈도우 확대, 축소, 이동, 아이콘으로 변환 등 • 윈도우 매니저 종류 • CDE on Sun Solaris, IBM AIX, HP/UX, ... • KDE on Linux http://www.kde.org • GNOME on Linux http://www.gnome.org • Twm, Mwm, Fvwm, Window Maker … on Linux • http://www.windowmaker.org

  8. 윈도우 매니저 GNOME • Panel • panel applet과 menu 들을 포함한다. • Panel applets은 판넬 내의 작은 프로그램 • 예 : the clock applet • Main Menu Button • Window 98의 시작 버튼과 같은 역할 • Desktop • 프로그램 • 데이터 • 디렉토리

  9. 윈도우 매니저 GNOME • 파일 관리자(File Manager) • 이동, 실행 • 복사, 이름 변경, 삭제 등 • 마우스 오른쪽 버튼을 이용 • 참조 • http://www.gnome.org/users-guide/index.html

  10. 윈도우 매니저 변경 • switchdesk • GNOME, KDE, AnotherLevel 중 선택

  11. X-window의 동작 과정 Display X client Terminal Screen X server X client Mouse Keyboard X client

  12. X-window의 동작 과정 • Display • consists of a terminal screen, a keyboard, and a mouse • X server • handles all the input and output of data at the display • one X server to each display • 보통 X-window는 X server를 의미함.

  13. X-window의 동작 과정 • X client • 디스플레이의 사용자와 대화하는 X 응용 프로그램 • X client의 예 • xterm, xclock, netscape, …. • 출력을 X server에 요청 • X server로부터 입력을 받음 • 마우스 클릭, 윈도우 이동, 키보드 누름, …

  14. X-window의 특징 • Client/Server 기반 윈도우 시스템 • X server와 X client • 네트워크 기반 윈도우 시스템 • X server와 X client가 같은 호스트 혹은 • 다른 호스트에 위치할 수 있다.

  15. Running Commands • Shell • a command line interpreter on UNIX • Bourne shell, Korn shell, C shell • date [yymmddhhmm [.ss]] • display or set current date and time • Online manual • man [chapter] word • man -k keyword • $man -k mode • $man chmod • $man 2 chmod

  16. Special Characters • Special characters • $ stty all • erase kill werase rprnt flush lnext susp • intr quit stop eof • Terminating a process • Control-C • standard way to interrupt the foreground job • Pausing output • Control-S/Control-Q

  17. Special Characters • End-of-input • Control-D • passwd • to set or change your password • at least six letters, should not a word from a dictionary

  18. File System • Directory hierarchy • tree structure • root directory bin usr dev home chang

  19. File System • Home directory • shell starts in your home directory when you login • assigned by the system administrator • Current working directory • a directory where your shell is currently working • home directory, when you login • How to change cwd ? • Moving to a directory • cd [directoryName]

  20. Pathname • Absolute path name • specify a file or directory by a pathname from the root directory / • /home/chang • Relative path name • specify a file or directory by a pathname relative to the cwd • . : current directory • .. : parent directory

  21. Commands for files • Listing the contents of a directory ls -adglsFR {fileName}* {directoryName}* -a : hidden files starting with . -l : long listing including permission, owner, modification time -d : directory not files -g : file's group -s : size -F : file type ( *, /) -R : recursively

  22. Commands for files • Listing a file cat -n {fileName}* more -f [+lineNumber] {fileName}* page -f [+lineNumber] {fileName}* head -n {fileName}* tail -n {fileName}*

  23. Commands for files • Renaming a file • mv -i oldFileName newFileName • mv -i {fileName}* directoryName • mv -i oldDirectoryName newDirectoryName • Making a directory • mkdir [-p] newDirectoryName • creates a new directory

  24. Commands for files • Copying a file • cp -i {fileName}* directoryName • cp -r directoryName1 directoryName2 • cp -i oldFileName newFileName • Deleting a file or directory • rmdir {directoryName}+ • rm -fir {fileName}+

  25. Commands for files • Printing a file • lpr -m [-Pprinter] [-#copies] {fileName}* • Counting the words in a file • wc -lwc {fileName}*

  26. File attributes • file name • file size • the number of physical blocks • file modification time • the the time that the file was last modified • file owner/group • the owner of the file • every process has an owner, which is the login user id • whenever a process creates a file, the file's owner is set to the process's owner

  27. File attributes • file type

  28. File attributes • permission mode

  29. Changing files

  30. Changing files

  31. Determining terminal's type • Terminal type • vi or emacs need to know your terminal type ! • Set shell envirionment variable $TERM to your terminal type (csh) %setenv TERM vt100 %tset (sh) $set TERM=vt100 $tset • Setting terminal type in shell's startup file .cshrc (csh) .profile (sh)

  32. Changing terminal's characteristics • Changing metacharacter setting • The default metacharacter settings may be overriden • stty -a {option}* {metacharacterString <value>}* erase, kill, lnext susp, intr, stop, eof $ stty erase ^b

  33. Graphical Text Editor on Linux • Xedit • 가장 간단한 그래픽 에디터 • Gedit • WordPad 정도의 기능을 가진 그래픽 에디터 • 파일 편집, 저장, 자르기, 복사, 붙이기, 찾기 등의 기능 • Gxedit • Graphical Text Editor • Editing Text documents and HTML documents • Mail • 읽기/쓰기/보내기

  34. Editor vi • A standard editor in UNIX • %vi filename • Two modes • command mode initial mode, editing commands • text entry mode enter text you'd like to enter

  35. Editor vi • How to enter text entry mode • By typing i, a, o, O, or R in command mode i Text is inserted in front of the cursor a Text is added after the cursor o/O Text is added after/before the current line R Text is replaced (overwritten) • You can not move around the screen using the cursor keys in text entry mode • Back to command modeby typing Esc

  36. Command mode

  37. Command mode

  38. Command mode

  39. Command mode

  40. Command mode

  41. Command mode

  42. Command mode

  43. Command mode

  44. Electronic Mail • Elm • a popular mail system in UNIX • sending mail % elm chang@cs.sookmyung.ac.kr (1) automatically vi is invoked and edit a mail (2) quit by typing :wq and send by typing <Enter> • reading mail % elm graphical user interface : move cursor and type return

  45. Electronic Mail • mail • mail -H [-f fileName] {address}* • sending mail % mail chang@cs.sookmyung.ac.kr % mail chang@cs.sookmyung.ac.kr < filename • reading mail % mail

  46. Electronic Mail • Netscape mailer • 윈도우에서 사용하는 netscape mailer와 동일하게 사용 가능

More Related