1 / 44

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

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 • cslinux1.sookmyung.ac.kr • cslinux2.sookmyung.ac.kr • Telnet • telnet cs.sookmyung.ac.kr • Modem • Hyperterminal, 새롬데이터맨 : 710-9251 • 전화접속 네트워킹 : 3789-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, ... • XFree86 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 • 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. X-window의 동작 과정 Display X client Terminal Screen X server X client Mouse Keyboard X client

  11. 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를 의미함.

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

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

  14. 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

  15. 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

  16. 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

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

  18. 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]

  19. 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

  20. 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

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

  22. 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

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

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

  25. File attributes • file name • 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

  26. File attributes • file type

  27. File attributes • permission mode

  28. Changing files

  29. Changing files

  30. 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 ansi %tset (sh) $set TERM=ansi $tset • Setting terminal type in shell's startup file .cshrc (csh) .profile (sh)

  31. 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

  32. 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

  33. 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

  34. Command mode

  35. Command mode

  36. Command mode

  37. Command mode

  38. Command mode

  39. Command mode

  40. Command mode

  41. Command mode

  42. 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

  43. 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

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

More Related