Quick viewing(Text Mode)

1 Get Started

1 Get Started

Outline • Working with the shell Get Started – Basic operations – Editing lines – System /settings

IT244 - Introduction to / and documents Instructor: Bo Sheng

Everything is case sensitive

1 2

Basic File Operations Basic File Operations • List files ( ) • Change directory ( ) – ls – cd / – (print working directory) – ls – ls / – pwd – ls /home (see your username?) – cd /home/your username/it244 – ls /home/shengbo/it244 – ls – pwd

3 4

Basic File Operations Basic File Operations • Read files ( ) • /create files ( ) – cat /home/shengbo/it244/welcome – ls – cat /var/run/motd.dynamic – echo “hello world” > hello – Some files are not readable (e.g., binary) – ls • cat /bin/cat – cat hello – echo “I am your name” >> hello – cat hello – cat hello hello

5 6

1 Basic File Operations Editing Command Lines • Execute files • Delete a char – /home/shengbo/it244/exetest – “backspace” and “delete” – Abort execution • Delete a word ( CTRL+ ) • CTRL+C • Delete a line ( CTRL+U ) • CTRL+Z and – /home/shengbo/it244/exetest – CTRL+Z – jobs • Arrow keys – kill %1 – Up / down: browse the command – jobs – Left / right: move the cursor

7 8

System info/settings Practice

– ls • shell we are using? – pwd – – ls / – ls /home • What OS is running? – – cd / • Something you can’t do (/) – ls – pwd – Try to create a file under / – cd /home/your username/it244 – pwd

9 10

Practice Help and Documents

– echo “hello world” > hello – ls • --help option – cat hello • System manuals ( man ) – echo “I am your name” >> hello – cat hello – man ls – cat hello hello – man cat – man ssh – /home/shengbo/it244/exetest – man man – Press ctrl+c – /home/shengbo/it244/exetest – CTRL+Z – jobs – kill %1 – jobs

11 12

2 Help and Documents • --help option • System manuals ( man ) – man ls – man cat – man ssh – man man • Reading long manuals – Press ENTER, SPACE, and Q

13 14

Help and Documents Summary • GNU info / pinfo (menu display) • File operations – info ls – ls, pwd, cd, cat, echo – info cat – CTRL+C, CTRL+Z, kill, jobs – info info – Control+h • System info ps, uname • Search Keyword – – man –k – • Help and documents – man, info, apropos, whatis – whatis

15 16

Questions • Use man and info to read the manual of ls and out how to distinguish files from directories.

• uname can display a lot system information. Find a way to display the OS “kernel name” and “kernel release”.

17

3