280 likes | 421 Views
Lecture 2: Get Started ( ch 2). IT244 - Introduction to Linux / Unix Instructor: Bo Sheng. Outline . Login to server Working with the shell. Login to Server. Server (hostname): it244a.cs.umb.edu it244b.cs.umb.edu SSH (Secure Shell, no more telnet )
E N D
Lecture 2: Get Started (ch 2) IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Outline • Login to server • Working with the shell
Login to Server • Server (hostname): • it244a.cs.umb.edu • it244b.cs.umb.edu • SSH (Secure Shell, no more telnet) • Use terminal (Linux/Mac OS clients) • Use other software tool (Windows client)
Login to Server • Server (hostname): • it244a.cs.umb.edu • it244b.cs.umb.edu • SSH (Secure Shell) • Use terminal (Linux/Mac OS clients) • Use other software tool (Windows client) • PuTTY • Instructions on course web page http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Login to Server • If you haven’t got an account • http://www.cs.umb.edu/sp/resources/other/faqs/#FAQ02 • If you haven’t register you account with this class
Login to Server • If you haven’t register you account with this class
Login to Server • If you haven’t register you account with this class
Login to Server (Windows) • PuTTY
Login to Server (Windows) • PuTTY
Login to Server • SSH (Secure Shell) • Use a terminal (Linux/Mac OS clients)
Login to Server • Open a terminal in Ubuntu
Login to Server • SSH (Secure Shell) • Use terminal (Linux/Mac OS clients) • sshusername@hostname • ssh –l username hostname e.g., • ssh shengbo@it244a.cs.umb.edu • ssh –l shengbo it244a.cs.umb.edu
Login to Server (Linux / Mac) • Terminal
Login to Server (Linux / Mac) • Terminal
Outline • Login to server • Working with the shell • Basic file operations • Editing command lines • System info/settings • Help and documents • Everything is case sensitive
Basic File Operations • List files ( ls ) • ls • pwd(print working directory) • ls / • ls /home (see your username?) • ls /home/shengbo/it244
Basic File Operations • Change directory ( cd ) • cd / • ls • pwd • cd /home/your username/it244 • ls • pwd
Basic File Operations • Read files ( cat ) • cat /home/shengbo/it244/welcome • cat /etc/motd • Some files are not readable (e.g., binary) • cat /bin/cat
Basic File Operations • Write/create files ( echo ) • ls • echo “hello world” > hello • ls • cat hello • echo “I am your name” >> hello • cat hello • cat hello hello
Basic File Operations • Execute files • /home/shengbo/it244/exetest • Abort execution • CTRL+C • CTRL+Z and kill • /home/shengbo/it244/exetest • CTRL+Z • jobs • kill %1 • jobs
Editing Command Lines • Delete a char • “backspace” and “delete” • Delete a word ( CTRL+W ) • Delete a line ( CTRL+U ) • Arrow keys • Up / down: browse the command history • Left / right: move the cursor
System info/settings • Which shell we are using? • ps • What OS is running? • uname • Change your passwd • passwd • Something you can’t do (su/sudo) • Try to create a file under /
Help and Documents • --help option • System manuals ( man) • man ls • man cat • man ssh • man man
Help and Documents • --help option • System manuals ( man) • man ls • man cat • man ssh • man man • Reading long manuals • Press ENTER, SPACE, and Q
Help and Documents • GNU info / pinfo(menu display) • info ls • info cat • info info • Search Keyword • man –k • apropos • whatis
Summary • File operations • ls, pwd, cd, cat, echo • CTRL+C, CTRL+Z, kill, jobs • System info • ps, uname, passwd • Help and documents • man, info, apropos, whatis
Questions • Use man and info to read the manual of ls and find out how to distinguish files from directories. • uname can display a lot more system information. Find a way to display the OS “kernel name” and “kernel release”. The expected output is “Linux 3.2.0-36-generic”