Download presentation
Presentation is loading. Please wait.
Published byHector Wilcox Modified over 8 years ago
1
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility
2
File Transfer Protocol (FTP) What is FTP? FTP is an application that can transfer files among various computer systems FTP is useful for: transferring programming files to diskette for printing, backup or installation on home PC transferring files from Phobos to computer terminal for editing (and vice versa) uploading HTML files to web server
3
File Transfer Protocol There are many ftp applications that are available in both Windows and Linux platforms. Windows: - Graphical (WS-FTP, MS-Explorer) - Command line (ftp command) Linux: - Graphical (Konqueror, gftp) - Command line (ftp command) Basically, identical to MS-Windows command-line ftp command!
4
ftp Command Very useful command since it is available in both MS-Windows 95 (upwards), Unix and Linux. Useful to learn if you want to transfer file(s) and no other ftp software is currently installed on computer (eg. If you are working on a client’s site)
5
ftp Command To connect to a remote server for file transfer, either open a Windows Run command dialog box, or in Unix/Linux access a shell and issue the following command: ftp servername Eg.ftp phobos.senecac.on.ca
6
ftp Command After entering your username and password, you will be brought to a prompt. If you will be transferring ascii files such as C programming code, or html webpages, issue the command ascii. If you will be transferring files other than ascii files (pictures, MS-Word documents, executable programs), issue the command binary. If you do not enter these correct “modes” to correctly transfer these files, you may damage the files, and they will not work properly!
7
ftp Command When you are connected to a server the following terms apply: Local Server – Your current machine (i.e. your PC or your Matrix account) Remote Server – Server that you are connected (eg. your Phobos account) Note: If your local machine has access to a floppy disk drive, you can transfer files for backup purposes!
8
ftp Command Commands to navigate throughout your remote server: lsList files pwdDisplay current directory cdChange remote directory Note: when using ftp program in MS- Windows, you can use dir command as well.
9
ftp Command Commands to navigate throughout your local server: !lsList files (if local is Unix/Linux) !pwdDisplay current directory lcdChange local directory Note: When using ftp from MS- Windows, use !dir to view local contents
10
ftp Command Commands to transfer files between local and remote server: remote -> local Server: get filename local -> remote Server: put filename Note: It is advised to set your local and remote directories before you transfer. The commands mget and mput can be used to copy multiple files using wildcard characters like *
11
ftp Command After transferring a file between servers, always verify that the transfer has been successfully completed (refer to commands to navigate throughout local and remote servers). To exit the ftp command, you can enter the commands: bye exit
12
Graphical ftp Application Many find it easier to use a graphical application. The next slide demonstrates the use of WS-FTP, which is a graphical FTP application available on computers at Seneca’s labs. After launching the application, you can click the CONNECT button, type the hostname/address and click OK (refer to sessions properties dialog box on the next slide. At some point, you will be prompted for your username and password.
13
Graphical ftp Application Here is how the application appears. After logging into the remote server, you can select, and then redirect files between the remote server and local PC.
14
vi (Visual) Editor vi is a powerful, interactive, visually-oriented text editor Features: Efficient editing by using keystrokes instead of mouse. Use of regular expressions possible to recover files after accidental loss of connect or “system crashs”. Features for programmers (eg. line numbering, auto- indent, etc…)
15
Starting vi Session There are two ways to start an editing session with vi: Enter vi filename (recommended since filename has already been assigned and changes will be saved to filename by enter ZZ while in vi). Enter vi (filename is not assigned, therefore user has to type :w filename in order to save file.
16
Modes There are three operational modes while using the vi editor: Command Mode (default mode when starting) User presses letter for a command – for example, input text, delete text, append text, etc. Input Mode Input Mode allows user to enter or edit text. Press ESC to return to command mode. Last-line Mode Pressing colon “:” opens a prompt to enter letter or word commands. More complex operations such as search and replace can be performed.
17
Moving in Command Mode You can move around to text in the screen by using the following keys: h (left), j (down), k (up), and l (right). w (right one word to special character), W (right one word including special characters) b (left one word to special character), B (left one word including special characters) 0 (zero) (beginning of line), $ (end of line) You may be able to move around by using the arrow keys (depends on version of vi). For more advanced editing, you can return to Command Mode and use appropriate editing commands.
18
Getting into Input Mode While in command mode, you can issue the following commands to input text: i – insert to left of cursor I – insert at beginning of line o – insert line below current line 0 – insert line above current line a - append to right of cursor A - append at end of current line r - replace character R – overwrite text NOTE: 1.To enter command mode while in input mode, press the key. 2. While in input mode, the input mode indicator should appear as INPUT on the bottom of the vi screen.If this indicator does not appear when you press i then type: :set showmode
19
Input Mode Error Correction (As you type): CTRL-hDelete a letter CTRL-wDelete a word CTRL-uDelete a line
20
Editing Commands (Within Command Mode) The major Text Editing Commands are: x – Delete single character d – Delete c – Change y – Yank (copy) p – paste below cursor, P – paste above cursor When combined with movement keys, the vi editor becomes an effective editing tool. eg. d4W(Delete the next four space-delimited words) c$(Change from the cursor to the end of the line) y$(Copy from cursor to the end of the line) d34d(Delete current line and following 33 lines) Pressing the period “.” in command mode will repeat the most recent edit!
21
Searching Search for text (in command mode) /patternSearch forward for pattern ?patternSearch backwards for pattern
22
Saving Edited File When you create a file using vi, all work performed during vi session is stored in a Work Buffer (temporary storage) until the user saves their work. When saving, changes in the work buffer are placed in a new file if creating a new file, or changes in work buffer modify existing (previously created) file.
23
Saving Edited File To save your vi session, you must make sure you are in command mode by pressing To save your changes and exit, enter ZZ (i.e. two capital z’s). You could perform the same operation in last line mode by :wx You can also save without exiting by entering :w
24
Aborting Editing Session If you make a huge mistake in your editing session (that undo cannot solve), you can abort your session without modifying the contents of your file (dump the work buffer) To abort the current editing session, press :q!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.