1 Get Started

1 Get Started

Outline • Working with the shell Get Started – Basic file operations – Editing command lines – System info/settings IT244 - Introduction to Linux / Unix – Help and documents Instructor: Bo Sheng Everything is case sensitive 1 2 Basic File Operations Basic File Operations • List files ( ls ) • Change directory ( cd ) – ls – cd / – pwd (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 ( cat ) • Write/create files ( echo ) – 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+W ) • CTRL+C • Delete a line ( CTRL+U ) • CTRL+Z and kill – /home/shengbo/it244/exetest – CTRL+Z – jobs • Arrow keys – kill %1 – Up / down: browse the command history – jobs – Left / right: move the cursor 7 8 System info/settings Practice – ls • Which shell we are using? – pwd – ps – ls / – ls /home • What OS is running? – uname – cd / • Something you can’t do (su/sudo) – 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 – apropos • Help and documents – man, info, apropos, whatis – whatis 15 16 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”. 17 3.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us