1 / 26

Week 2 Lab Agenda

Week 2 Lab Agenda. Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi. Command Line FTP. Open connection Set transfer mode Transfer single / multiple file(s) Execute command in remote server Execute command in local machine

harva
Download Presentation

Week 2 Lab Agenda

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. Week 2 Lab Agenda • Command Line FTP • Commands Review • More UNIX commands to learn • File name expansion - * • Introduction of vi May 16, 2005

  2. Command Line FTP Open connection Set transfer mode Transfer single / multiple file(s) Execute command in remote server Execute command in local machine Close FTP connection May 16, 2005

  3. Open the FTP Connection $ftp ftp > open matrix.senecac.on.ca OR: $ftp matrix.senecac.on.ca May 16, 2005 source: Ling Zhu

  4. Set the Transfer Mode Set to ASCII mode: ftp > asc Set to binary mode: ftp > bin May 16, 2005 source: Ling Zhu

  5. Commands to transfer file(s) Transfer a single file: ftp > get ftp > put Transfer multiple files–Use file name expansion ftp > mget *.html ftp > mput lecture?? source: Ling Zhu May 16, 2005

  6. Execute Commands on Remote Server ftp > cd dirctoryName ftp > pwd ftp > ls source: Ling Zhu May 16, 2005

  7. Execute Commands on Local Machine Windows machine UNIX/Linux machine ftp >lcd dirctoryName ftp >!cd ftp >!dir ftp >!cd dirctoryName ftp >!pwd ftp >!ls source: Ling Zhu May 16, 2005

  8. Close the FTP Connection ftp > close OR: ftp > bye May 16, 2005 source: Ling Zhu

  9. Commands we have learned • cd $HOME • cd ~ • cd • cd – May 16, 2005 source: Ling Zhu

  10. Commands we have learned • ls • ls –l • ls –a May 16, 2005 source: Ling Zhu

  11. Commands we have learned • touchfilename • mkdir directoryname May 16, 2005 source: Ling Zhu

  12. Commands we have learned • passwd • pwd May 16, 2005 source: Ling Zhu

  13. So far we know how to After Lab1, you should know how to: • log in • change your password • create a file • list the files in your working directory • create a directory • display the name of your working directory • change directories • log out May 16, 2005 source: Ling Zhu

  14. How to know a command more man command • Press space bar or type f to go forward • Type b to go backward • Type q to exit May 16, 2005 source: Ling Zhu

  15. More Symbols • . current working directory • . . parent directory • . ./.. grandparent directory May 16, 2005 source: Ling Zhu

  16. More Commands to learn • cp source destination Copy file • mv source destination Rename file May 16, 2005 source: Ling Zhu

  17. Can you answer them? • cp policydestination • What if destination is a file that doesn’t exist? • What if destination is a file that exists? • What if destination is a directory? • What if there is a policy file under destination? • mv policydestination • Can you answer the last four questions? May 16, 2005 source: Ling Zhu

  18. More Commands to learn To view a file • cat filename • head filename - display top 10 lines head - n3file1- display top 3 lines head -3file1- display top 3 lines • tail filename - display last 10 lines tail –2file1 - display last 2 lines • more filename - can only scroll down • less filename - can scroll up and down May 16, 2005 source: Ling Zhu

  19. More Commands to learn • rm filename Delete file - eg: rm file1 - delete file named file1 • rm –r dirctoryname Delete directory - eg: rm – r dir1 - delete directory named dir1 • rmdir directoryname Delete empty directory - eg: rmdir dir2 - delete empty directory dir2 May 16, 2005 source: Ling Zhu

  20. Introduction of vi Three modes of vi • command mode • insert mode • last line mode May 16, 2005 source: Ling Zhu

  21. Introduction of vi – command mode Cursor movement • h • j • k • l Delete text • x • dd Undo edit • u – move to left – move to next line – move to last line – move to right – delete one character – delete one line – undo your last edit May 16, 2005 source: Ling Zhu

  22. Introduction of vi – command mode • – move back 4 characters • – move down 5 lines • – move up 3 lines • – delete two character from the cursor • – delete three lines 4h 5j 3k 2x 3dd May 16, 2005 source: Ling Zhu

  23. Introduction of vi – insert mode Insert text • i • I • a • A • o • O – insert text at left of the cursor – insert text at the beginning of the cursor line – insert text at right of the cursor – insert text at the end of the cursor line – open a new line under the cursor line – open a new above the cursor line May 16, 2005 source: Ling Zhu

  24. Introduction of vi – last line mode Start with : and end with hitting Enter • – display line number • – hide line number • – save and exit vi • – save without exit vi • – exit vi when no change • – exit vi without saving any change : set nu : set nonu : wq : w : q : q! May 16, 2005 source: Ling Zhu

  25. Introduction of vi – Switch mode ESC – Escape from insert mode May 16, 2005 source: Ling Zhu

  26. Warning Unix/Linux commands are case sensitive!! If you issue LS rather than ls, you will lose mark!! May 16, 2005

More Related