Báo cáo Tìm hiểu bộ lệnh của dịch vụ FTP

Mục lục

Chương 1: FTP là gì, sử dụng ra sao 4

1.1. FTP là gì 4

1.2. Bắt đầu sử dụng FTP 5

Chương 2. Tạo FTP Server 6

2.1. Tạo tài khoản trên Host có hỗ trợ giao thức FTP 6

2.2. Tạo FTP Server trên máy tính cá nhân của mình 9

2.3. Truy nhập vào máy tính FTP server vừa tạo ra 15

Chương 3. Bộ lệnh FTP 16

3.1. Một số tùy chọn FTP 16

3.2. Danh sách một số lệnh FTP đơn giản 17

3.3. Viết tắt của một số lệnh trong bộ lệnh FTP 18

3.4. Cú pháp, ý nghĩa, cách dùng của các câu lệnh FTP 20

3.4.1.Nhóm các lệnh thao tác với FTP Server 20

! 20

? 20

Open 21

Close 21

Bye 21

Disconnect 22

Ascii 22

Binary 22

User 23

Bell 23

Status 24

Type 24

3.4.2. Nhóm các lệnh thao tác với File 25

Append 25

Get 25

Recv 26

Put 26

Send 27

Delete/Dele 28

Mget 29

Mput 29

Mdelete/ mdele 30

Rename 32

3.4.3. Nhóm các lệnh thao tác với Directory 33

Cd 33

Lcd 33

Ls 34

Dir 35

Mdir 35

Mkdir 36

Rmdir 37

Pwd 37

Chương 4. Giới thiệu một số phần mềm FTP client 39

4.1. Giới thiệu phần mềm Cute FTP Pro 8.0.2 39

Chương 5. Kết luận 42

Chương 6. Tài liệu tham khảo 43

 

 

doc43 trang | Chia sẻ: maiphuongdc | Lượt xem: 4918 | Lượt tải: 2download
Bạn đang xem trước 20 trang tài liệu Báo cáo Tìm hiểu bộ lệnh của dịch vụ FTP, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
trình như sau Hình 2.2.4. Màn hình kết nối Ta tạo User và cấp quyền, tạo thư mục để chia sẻ dữ liệu cho user. Vào Edit -> User. Cửa sổ Users xuất hiện, bạn chọn tab General. Hình 2.2.5. Cửa sổ Users Chọn Add, cửa sổ Add user account xuất hiện, bạn điền tên và chọn nhóm, có thể chọn none. Đặt lại password cho user. Click vào Shared folder -> Chọn Add. Bạn chọn thư mục mà user vừa tạo bên trên sẽ làm việc ở đấy. Có thể chọn các quyền cho user đó như: Read, Write, Delete, Append… Mặc định là Read(chỉ đọc). Hình 2.2.5. Cửa sổ Shared folder Cấu hình lại cho Firewall. Đối với Windows 7, Vista. Windows XP có thể bỏ qua bước này. Đầu tiên, vào trong Control Panel -> System and Securiy -> Window Firewall -> Allow a program or feature thought Windows Firewall. Màn hình xuất hiện như sau. Hình 2.2.6. Cấu hình lại Firewall Tại góc trên bên phải ta chọn Change setting… Sau đó ta chọn Allow another program. Tìm đến đường dẫn: C:\Program Files\FileZilla Server. Tìm đến file FileZilla Server Interface. Sau đó click Open HÌnh 2.2.7. Chọn FileZilla Interface Chọn Add. . Ta làm tương tự như thế với FileZilla Server Hình 2.2.8. Add FileZilla Interface 2.3. Truy nhập vào máy tính FTP server vừa tạo ra Trong mạng LAN Trong mạng LAN để truy cập vào máy tính FTP Server bạn bật trình duyệt và gõ ftp://Ip-Address-LAN , đây là địa chỉ IP của máy tính trong mạng LAN, thường là 192.168.1.x. Khi đăng nhập bạn điền User + Pass đã tạo phía bên trên. Trình duyệt đăng nhập thành công với User ftp_admin, pass: admin1. Hình 2.3.1. Thư mục được chia sẻ khi đăng nhập FTP server Trên Internet Bạn vào địa chỉ sau để lấy địa chỉ IP của bạn mà nhà mạng cung cấp cho www.ipaddress.com Sau khi có địa chỉ IP bạn nhập vào thanh địa chỉ của trình duyệt web như sau: ftp://ipaddress.com. Chú ý là máy tính trong mạng LAN của mình sẽ không vào được địa chỉ WAN, mà chỉ có máy tính trên Internet mới truy cập vào được. Nhập User + Pass và đăng nhập vào thư mục chia sẻ. Chương 3. Bộ lệnh FTP 3.1. Một số tùy chọn FTP Khi bắt đầu chương trình từ Commad Prompt ta có thêm các tùy chọn như sau: ftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer]. Trong đó: -v: Chặn những hồi đáp dài dòng từ máy chủ: C:\>ftp –v C:\Documents and Settings\August_star>ftp -v ftp> open ftp.vnn.ms User (ftp.vnn.ms:(none)): vnnm_6327076 Password: ftp> open ftp.vnn.ms Already connected to ftp.vnn.ms, use disconnect first. ftp> bye -d: Bật Debugging và hiển thị tất cả các câu lệnh đã được thông qua giữa Client và Server: C:\>ftp –d ftp> dir ---> PORT 192,168,1,8,10,223 200 PORT command successful ---> LIST -i: Tắt hộp thoại nhắc nhở tương tác trong khi truyền tải nhiều file: C:\>ftp –i -g: Vô hiệu hóa các tên file Globbing, loại cho phép sử dụng các ký tự đại diện và tên đường dẫn: C:\>ftp –g -s:filename: Specifies a text file containing ftp commands; the commands will automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>). -a: Use any local interface when binding data connection. -w:windowsize - Overrides the default transfer buffer size of 4096. computer - Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last parameter on the line. -n: Restrain ftp from attempting `auto-login' upon initial connection. If auto-login is enabled, ftp will check the .netrc (see below) file in the user's home directory for an entry describing an account on the remote machine. If no entry exists, ftp will prompt for the remote machine login name (default is the user identity on the local machine), and, if necessary, prompt for a password and an account with which to login. 3.2. Danh sách một số lệnh FTP đơn giản ? Yêu cầu giúp đỡ hoặc thông tin từ bộ lệnh FTP ascii Đặt chế độ truyền file thành ASCII  Binary Đặt chế độ truyền file thành Binary bye Thoát khỏi môi trường FTP (tương tự lệnh  quit) cd Thay đổi thư mục hiện tại của server close Kết thúc kết nối với máy khác close brubeck Đóng kết nối FTP hiện thời với  brubeck,    nhưng vẫn để bạn ở trong môi trường FTP delete Xóa 1 file trên thư mục của server(giống lệnh  rm trong UNIX) get Sao chép 1 file từ máy server về máy tính client get ABC DEF Sao chép file ABC từ thư mục từ server về một file tên là DEF ở thư mục của máy tính client. get ABC Sao chép file ABC ở thư mục hiện tại của server về 1 file có tên tương tự ABC tại máy tính client. help Yêu cầu danh sách các lệnh FTP thực thi lcd Thay đổi(chuyển) thư mục trên máy tính client ls Hiển thị các file ở thư mục hiện tại đang truy cập mkdir Tạo 1 thư mục mới bên trong thư mục đang truy cập hiện tại. mget Sao chép nhiều file từ server về máy tính client. Bạn sẽ được cảnh báo trả lời y/n trước khi truyền tải mỗi file.(download) mget * Sao chép tất cả các tệp ở thư mục truy cập hiện tại về thư mục hiện tại của client, sử dụng trùng tên file. mput Sao chép nhiều file từ máy client lên máy server(Upload). Bạn sẽ được cảnh báo y/n trước khi truyền tải file open Mở nột kết nối tới máy khác open brubeck Mở một kết nối FTP với brubeck. Bạn phải nhập Username và Password cho tài khoản brubeck (trừ trường hợp đó là một kết nối nặc danh). put Sao chép 1 file từ máy client lên máy tính server(Upload) pwd Hiển thị đường dẫn của thư mục hiện tại trên máy server quit Thoát khỏi môi trường FTP(giống lệnh bye) rmdir Xóa một thư mục trong thư mục đang được truy cập 3.3. Viết tắt của một số lệnh trong bộ lệnh FTP ABORT - abort a file transfer CD: Change directory CWD - change working directory DELE - delete a remote file LIST - list remote files LCD – Local change directory MDTM - return the modification time of a file MKD = MKDIR - make a remote directory MPUT: Multiple put local file MGET: Multiple get remote file NLST - name list of remote directory PASS - send password PASV - enter passive mode PORT - open a data port PWD - print working directory QUIT - terminate the connection RETR - retrieve a remote file RMD - remove a remote directory RNFR - rename from RNTO - rename to SITE - site-specific commands SIZE - return the size of a file STOR - store a file on the remote host RMDIR – Remove directory TYPE - set transfer type USER - send username ACCT* - send account information APPE - append to a remote file CDUP - CWD to the parent of the current directory HELP - return help on using the server MODE - set transfer mode NOOP - do nothing REIN* - reinitialize the connection STAT - return server status STOU - store a file uniquely STRU - set file transfer structure SYST - return system type 3.4. Cú pháp, ý nghĩa, cách dùng của các câu lệnh FTP 3.4.1.Nhóm các lệnh thao tác với FTP Server ! Ý nghĩa: Thực thi lệnh chỉ định trên máy tính client Cú pháp : ! [command] Tham số: Các lệnh chỉ định để thực thi bên trên máy client Ví dụ: thực thi lệnh dir tại thư mục hiện tại trên máy client ftp> ! dir Volume in drive D is Study Volume Serial Number is 7C2C-53E4 Directory of D:\study\Dotnet\Ngay 1 12/14/2010 10:02 PM . 12/14/2010 10:02 PM .. 12/02/2010 11:09 PM Database 12/14/2010 10:02 PM day 1 11/25/2010 07:06 PM doc 11/25/2010 07:06 PM sql 0 File(s) 0 bytes 6 Dir(s) 3,082,604,544 bytes free ? Ý nghĩa: Hiển thị mô tả cho các câu lệnh FTP Cú pháp: ? [command] Tham số : chỉ ra các lệnh mà bạn muốn được diễn tả về nó. Ví dụ: trợ giúp một số lệnh như dir, ls, dele ftp> ? dir dir List contents of remote directory ftp> ? ls ls List contents of remote directory ftp> ? dele delete Delete remote file ftp> Open Ý nghĩa: Mở 1 kết nối tới FTP server Cú pháp: Open FTP server Tham số FTP server: địa chỉ IP hoặc địa chỉ tên miền của FTP server Ví dụ: Kết nối vào ftp://ftp.vnn.ms ftp> open ftp.vnn.ms Connected to ftp.vnn.ms. 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 109 of 500 allowed. 220-Local time is now 05:34. Server port: 21. 220-This is a private system - No anonymous login 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 2 minutes of inactivity. ftp> Close Ý nghĩa: Đóng kết nối tới FTP server , trở về môi trường FTP Cú pháp: Close Tham số Ví dụ: Đóng kết nối ftp://ftp.vnn.ms ftp> close 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. ftp> Bye Ý nghĩa: Đóng kết nối tới FTP server và thoát khỏi môi trường FTP Cú pháp: Bye Tham số Ví dụ: Đóng kết nối ftp://ftp.vnn.ms ftp> bye 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. C:\Documents and Settings\August_star>. Disconnect Ý nghĩa: Ngắt kết nối với FTP server, trở về môi trường FTP Cú pháp: Disconnect Tham số Ví dụ: Ngắt kết nối với FTP server ftp> disconnect 221 Goodbye ftp> Ascii Ý nghĩa: Đặt chế độ truyền file là ASCII, mặc định Cú pháp: Ascii Tham số Ghi chú: FTP hỗ trợ 2 kiểu truyền file là Ascii và Binary images. Khi sử dụng truyền file text thì Ascii được khuyên dùng hơn. Ví dụ: Đặt lại chế độ truyền file là Ascii ftp> Ascii 200 TYPE is now ASCII ftp> Binary Ý nghĩa: Đặt chế độ truyền file là ASCII, mặc định Cú pháp: Ascii Tham số Ghi chú: FTP hỗ trợ 2 kiểu truyền file là Ascii và Binary images. Khi sử dụng truyền file thực thi thì Binay được khuyên dùng hơn. Ở chế độ Binay các file được chuyển theo từng byte một. Ví dụ: Đặt lại chế độ truyền file là Binary ftp> Binary 200 TYPE is now BINARY ftp> User Ý nghĩa: Chỉ định user để kết nối vào FTP server Cú pháp: User User-name [password][accout] Tham số User – name: tên tài khoản chỉ định muốn đăng nhập vào FTP server Password: Mật khẩu của User – name tương ứng Ví dụ: Gửi User user2 truy nhập vào FTP server ftp> user Username user2 331 Password required for user2 Password: 230 Logged on ftp> Bell Ý nghĩa: kích hoạt chuông báo sau mỗi lần truyền tải file thành công. Mặc định là bell = off Cú pháp:Bell Tham số Ví dụ: Kích hoạt chuông báo ftp> Bell Bell mode Off ftp> Status Ý nghĩa: Hiển thị trạng thái của kết nối FTP Cú pháp:Status Tham số Ví dụ: Hiển thị trạng thái của kết nối ftp> status Connected to 192.168.1.2. Type: ascii; Verbose: On ; Bell: Off ; Prompting: On ; Globbing: On Debugging: Off ; Hash mark printing: Off . ftp> Type Ý nghĩa: Hiển thị hoặc đặt lại kiểu truyền file Cú pháp:Type [type - name] Tham số Type – name: Có thể là Binary hoặc Ascii(Xem bên trên). Ví dụ: Xem và đặt lại kiểu truyền file ftp> type Using ascii mode to transfer files. ftp> type binary 200 Type set to I ftp> type ascii 200 Type set to A 3.4.2. Nhóm các lệnh thao tác với File Chú ý: Các lệnh thao tác với file tùy theo quyền hạn mà Ftp Client có mà có thể thực hiện được những lệnh, thao tác nào đó. Mặc định thì phía Ftp Client thường chỉ là xem và tài file về máy. Khi được cấp quyền hạn cao hơn như là Xóa, tải lên…. FTP cho phép truyền và tải files, quản lý thư mục, và lấy mail.FTP không được thiết kế để truy nhập và thi hành files. Append Ý nghĩa: Đính(copy nội dung ) 1 file từ máy client vào 1 file trên máy server Cú pháp: Append Local – file[remote - file] Tham số Local – file: chỉ định các file để thêm vào Remote – file: file được chỉ định trên máy server mà file client sẽ thêm vào. Nếu remote – file trống thì local – file sẽ đóng vai trò là remote – file. Ví dụ: Đính file Append.txt vào file newtext.txt ftp> append Append.txt newtext.txt 200 PORT command successful 150 Connecting to port 2456 226-File successfully transferred 226 0.562 seconds (measured here), 2.01 Kbytes per second ftp: 1186 bytes sent in 0.00Seconds 1186000.00Kbytes/sec. ftp> Get Ý nghĩa: download một file từ phía FTP server về máy tính FTP client với phương thức truyền file hiện tại. Cú pháp: Get remote - file [local – file] Tham số Remote - file: file được chỉ định từ FTP server Local - file: tên file được chỉ định khi copy về máy. Nếu bỏ trống thì tên file khi được download về máy là tên trên FTP server. Ví dụ: download file GetFile.txt về ổ C với tên là GetFile.txt ftp> get GetFile.txt C:\\GetFile.txt 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK ftp: 4 bytes received in 0.00Seconds 4000.00Kbytes/sec. ftp> Recv Ý nghĩa: download một file từ phía FTP server về máy tính FTP client với phương thức truyền file hiện tại. Tương tự lệnh GET Cú pháp: Recv remote - file [local – file] Tham số Remote - file: file được chỉ định từ FTP server Local - file: tên file được chỉ định khi copy về máy. Nếu bỏ trống thì tên file khi được download về máy là tên trên FTP server Ví dụ: download file RecvFile.txt về C:\\ftpDown\\FileDown.txt ftp> recv RecvFile.txt C:\\ftpDown\\fileDown.txt 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK ftp> Put Ý nghĩa: upload một file từ phía FTP client lên máy tính FTP server với phương thức truyền file hiện tại. Cú pháp: Put local - file [remote – file] Tham số Local - file: file được chỉ định từ FTP client Remote - file: tên file được chỉ định khi tải lên FTP server. Nếu bỏ trống thì tên file khi được download về máy là tên trên FTP client Ví dụ: upload file PutFile.txt vào thư mục Bitmap/PutFile.txt ftp> put C:\\PutFile.txt bitmap/PutFile.txt 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK ftp: 4 bytes sent in 0.00Seconds 4000.00Kbytes/sec. ftp> cd bitmap 250 CWD successful. "/bitmap" is current directory. ftp> dir 200 Port command successful 150 Opening data channel for directory list. -rw-r--r-- 1 ftp ftp 4 Apr 10 00:02 PutFile.txt 226 Transfer OK ftp: 62 bytes received in 0.00Seconds 62000.00Kbytes/sec. ftp> Send Ý nghĩa: upload một file từ phía FTP client lên máy tính FTP server với phương thức truyền file hiện tại. Giống với lệnh PUT Cú pháp: Send local - file [remote – file] Tham số Local - file: file được chỉ định từ FTP client Remote - file: tên file được chỉ định khi tải lên FTP server. Nếu bỏ trống thì tên file khi được download về máy là tên trên FTP client Ví dụ: Upload file text.txt lên ftp> send SendFile.txt forUp.txt 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 ebook -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 file.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:45 forUp.txt drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software -rw-r--r-- 1 ftp ftp 0 Apr 10 10:38 text.txt 226 Transfer OK ftp: 469 bytes received in 0.00Seconds 469000.00Kbytes/sec. ftp> Delete/Dele Ý nghĩa: Xóa 1 file trên thư mục hiện tại của FTP server Cú pháp: Delete remote - file Tham số Remote - file: file được chỉ định từ FTP server Ví dụ: Xóa file forFtp.txt ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 CLGT.thm drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 ebook -rw-r--r-- 1 ftp ftp 4 Apr 09 23:02 forFtp.txt drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 411 bytes received in 0.00Seconds 411000.00Kbytes/sec. ftp> delete forftp.txt 250 File deleted successfully ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 CLGT.thm drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 ebook drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 350 bytes received in 0.00Seconds 350000.00Kbytes/sec. ftp> Mget Ý nghĩa: download một hoặc nhiều file từ phía FTP server về máy tính FTP client với phương thức truyền file hiện tại. Cú pháp: Mget [ remote - files] Tham số Remote - files: một hoặc nhiều file được chỉ định từ FTP server Hoặc cũng có thể sử dụng cú pháp sau. Mget *: download toàn bộ các file tại thư mục hiện thời trên FTP server Mget *.filetype: download toàn bộ các file có cùng đuôi mở rộng(filetype: doc, rar, txt, pdf, exe…) Khi download, sẽ có hỏi bạn đồng ý download các file đấy về không(y/n). Ví dụ 1: download các file forUp.txt, forDown.txt ftp> mget forUp.txt forDown.txt mget forUp.txt? y mget forDown.txt? y ftp> Ví dụ 2: download các file có đuôi mở rộng là *.txt ftp> mget *.txt mget fileUp.txt? y mget forDown.txt? y mget forUp.txt? y ftp> Mput Ý nghĩa: upload một hoặc nhiều file từ phía FTP client lên phía FTP server với phương thức truyền file hiện tại. Cú pháp: Mput [ remote - files] Tham số Remote - files: một hoặc nhiều file được chỉ định từ FTP server Hoặc cũng có thể sử dụng cú pháp sau. Mput *: upload toàn bộ các file tại thư mục hiện thời trên FTP server Mput *.filetype: upload toàn bộ các file có cùng đuôi mở rộng(filetype: doc, rar, txt, pdf, exe…) Khi upload, sẽ có hỏi bạn đồng ý upload các file đấy về không(y/n). Ví dụ 1: upload các file có đuôi mở rộng là *.txt lên thư mục ebook ftp> dir 200 Port command successful 150 Opening data channel for directory list. -rw-r--r-- 1 ftp ftp 0 Apr 10 17:21 file.doc 226 Transfer OK ftp: 59 bytes received in 0.00Seconds 59000.00Kbytes/sec. ftp> mput *.txt mput forDown.txt? y 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK mput forUp.txt? y 200 Port command successful 150 Opening data channel for file transfer. 226 Transfer OK ftp> dir 200 Port command successful 150 Opening data channel for directory list. -rw-r--r-- 1 ftp ftp 0 Apr 10 17:21 file.doc -rw-r--r-- 1 ftp ftp 0 Apr 10 17:22 forDown.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 17:22 forUp.txt 226 Transfer OK ftp: 181 bytes received in 0.00Seconds 181000.00Kbytes/sec. ftp> Mdelete/ mdele Ý nghĩa: Xóa một hoặc nhiều file trên phía FTP server Cú pháp: Mdelete [remote - files] Tham số Remote - files: một hoặc nhiều file được chỉ định từ FTP server Hoặc cũng có thể sử dụng cú pháp sau. Mdelete *: xóa toàn bộ các file tại thư mục hiện thời trên FTP server Mdelete *.filetype: xóa toàn bộ các file có cùng đuôi mở rộng(filetype: doc, rar, txt, pdf, exe…) Khi xóa, sẽ có hỏi bạn đồng ý xóa các file đấy về không(y/n). Ví dụ 1: xóa tất cả các file có đuôi mở rộng là *.txt . ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap drwxr-xr-x 1 ftp ftp 0 Apr 10 17:22 ebook -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 fileUp.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:38 forDown.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:45 forUp.txt drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 474 bytes received in 0.00Seconds 474000.00Kbytes/sec. ftp> mdele *.txt 200 Type set to A mdele fileUp.txt? y 250 File deleted successfully mdele forDown.txt? y 250 File deleted successfully mdele forUp.txt? y 250 File deleted successfully ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap drwxr-xr-x 1 ftp ftp 0 Apr 10 17:22 ebook drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 291 bytes received in 0.00Seconds 291000.00Kbytes/sec. ftp> Ví dụ 2: xóa tất cả các file có trong thư mục ftp> dir 200 Port command successful 150 Opening data channel for directory list. -rw-r--r-- 1 ftp ftp 0 Apr 10 17:21 file.doc -rw-r--r-- 1 ftp ftp 0 Apr 10 17:22 forDown.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 17:22 forUp.txt 226 Transfer OK ftp: 181 bytes received in 0.00Seconds 181000.00Kbytes/sec. ftp> mdele * 200 Type set to A mdele file.doc? n mdele forDown.txt? n mdele forUp.txt? n ftp> Rename Ý nghĩa: Đổi tên file trên FTP server Cú pháp: Rename filename newfilename Tham số Filename: file được chỉ định muốn đổi tên Newfilename: tên mới cho file Ví dụ: Đổi tên file text.txt thành file forUp.txt ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 ebook -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 fileUp.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:45 forUp.txt drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software -rw-r--r-- 1 ftp ftp 0 Apr 10 10:38 text.txt 226 Transfer OK ftp: 471 bytes received in 0.00Seconds 471000.00Kbytes/sec. ftp> rename text.txt forDown.txt 350 File exists, ready for destination name. 250 file renamed successfully ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 00:02 bitmap drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 ebook -rw-r--r-- 1 ftp ftp 0 Mar 28 10:38 fileUp.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:38 forDown.txt -rw-r--r-- 1 ftp ftp 0 Apr 10 10:45 forUp.txt drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 474 bytes received in 0.00Seconds 474000.00Kbytes/sec. ftp> 3.4.3. Nhóm các lệnh thao tác với Directory Cd Ý nghĩa: chuyển thư mục trên FTP server Cú pháp: Cd remote – directory Tham số Remote – directory: thư mục được chỉ định để thay đổi Cd .. : trở về thư mục trước đó Cd … : trở về thư mục gốc của user Ví dụ: Thay đổi thư mục ftp> cd bitmap 250 CWD successful. "/bitmap" is current directory. ftp> cd bit 250 CWD successful. "/bitmap/bit" is current directory. ftp> cd .. 250 CWD successful. "/bitmap" is current directory. ftp> cd ... 250 CWD successful. "/" is current directory. ftp> Lcd Ý nghĩa: chuyển thư mục trên FTP client Cú pháp: Lcd [directory] Tham số directory: thư mục được chỉ định trên máy tính FTP client để thay đổi. Nếu bỏ trống thì thư mục hiện tại đang làm việc sẽ được hiển thị lên. Cd .. : trở về thư mục trước đó Ví dụ: Thay đổi thư mục ftp> lcd Local directory now C:\ftpUp. ftp> lcd C:\ftpserver Local directory now C:\FtpServer. ftp> lcd .. Local directory now C:\. ftp> Ls Ý nghĩa: hiển thị danh sách ngắn gọn của các file của thư mục gốc và thư mục con của FTP server Cú pháp: Ls [remote - directory] Tham số Remote - directory: thư mục được chỉ định trên máy tính FTP server sẽ được hiển thị. Nếu bỏ trống thì thư mục hiện tại đang làm việc sẽ được hiển thị lên. Ví dụ 1: Hiển thị danh sách toàn bộ các file của thư mục gốc và thư mục con của user ftp> ls 200 Port command successful 150 Opening data channel for directory list. bitmap d ebook New Folder picture sd Software 226 Transfer OK ftp: 53 bytes received in 0.00Seconds 53000.00Kbytes/sec. ftp> Ví dụ 2: Hiển thị danh sách các file và thư mục bên trong bitmap ftp> ls bitmap 200 Port command successful 150 Opening data channel for directory list. bitmap/bit 226 Transfer OK ftp: 12 bytes received in 0.00Seconds 12000.00Kbytes/sec. ftp> ls Dir Ý nghĩa: hiển thị danh sách các file và thư mục con trên FTp server Cú pháp: Dir [remote - directory] Tham số Remote - directory: thư mục được chỉ định trên máy tính FTP server muốn hiển thị. Nếu bỏ trống thì thư mục hiện tại đang làm việc sẽ được hiển thị lên. Ví dụ: Hiển thị toàn bộ các file và thư mục con ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Apr 10 22:22 bitmap -rw-r--r-- 1 ftp ftp 0 Apr 10 21:05 d drwxr-xr-x 1 ftp ftp 0 Apr 10 17:22 ebook drwxr-xr-x 1 ftp ftp 0 Mar 31 09:21 New Folder drwxr-xr-x 1 ftp ftp 0 Mar 25 22:10 picture -rw-r--r-- 1 ftp ftp 0 Apr 10 18:44 sd drwxr-xr-x 1 ftp ftp 0 Mar 26 20:02 Software 226 Transfer OK ftp: 396 bytes received in 0.00Seconds 396000.00Kbytes/sec. ftp> ls Mdir Ý nghĩa: hiển thị danh sách các file và thư mục con trên FTp server Cú pháp: Mdir remote – files[…]local-file Tham số Remote - directory: thư mục được chỉ định trên máy tính FTP server muốn hiển thị. Nếu bỏ trống thì thư mục hiện tại đang làm việc sẽ được hiển thị lên. Ví dụ: Hiển thị toàn bộ các file và thư mục con ftp> mdir d.txt C://fileDown.txt output to local-file: C://fileDown.txt? n ftp> mdir *.txt C://fileDown.txt output to local-file: C://fileDown.txt? y 200 Port command

Các file đính kèm theo tài liệu này:

  • docBuiVanTuyen_DeTai_13.doc
  • pptxBuiVanTuyen_DeTai_13.pptx
  • pdfQuanTriMangNangCao.pdf
Tài liệu liên quan