Presentation is loading. Please wait.

Presentation is loading. Please wait.

1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.

Similar presentations


Presentation on theme: "1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi."— Presentation transcript:

1 1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi

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

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

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

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

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

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

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

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

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

11 11May 16, 2005 Commands we have learned touch filename touch filename mkdir directoryname source: Ling Zhu

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

13 13May 16, 2005 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 source: Ling Zhu

14 14May 16, 2005 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 source: Ling Zhu

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

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

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

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

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

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

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

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

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

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

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

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


Download ppt "1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi."

Similar presentations


Ads by Google