⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 427-430.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Configuration and Installation:Linux and the Internet</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=1558285660//-->

<!--TITLE=Linux Configuration and Installation//-->

<!--AUTHOR=Patrick Volkerding//-->

<!--AUTHOR=Kevin Reichard//-->

<!--AUTHOR=Eric Foster//-->

<!--PUBLISHER=IDG Books Worldwide, Inc.//-->

<!--IMPRINT=M & T Books//-->

<!--CHAPTER=9//-->

<!--PAGES=427-430//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="423-427.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="430-432.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading15"></A><FONT COLOR="#000077">Free Software and FTP</FONT></H4>

<P>Linux also features <B>ftp</B>, a command that allows you to link directly to another computer using the network TCP/IP. Essentially, if you have a TCP/IP connection to the Internet, you can use <B>ftp</B> to connect to any public site on the Net. In this section, we&#146;ll guide you through an FTP session.</P>

<H4 ALIGN="LEFT"><A NAME="Heading16"></A><FONT COLOR="#000077">Using FTP</FONT></H4>

<P>The <B>ftp</B> command can be used to connect to any other computer on your network running <B>ftp</B>. If your system is connected to the Internet, you can use <B>ftp</B> to access files from other Internet computers worldwide. The machines with which you network may or may not be running the UNIX or Linux operating systems; this operating-system independence is what makes FTP so widely used.</P>

<P>FTP is interactive software, which means it asks for information at specific times. Start it with the following:</P>

<!-- CODE SNIP //-->

<PRE>

     gilbert:/$ ftp

     ftp&gt;

</PRE>

<!-- END CODE SNIP //-->

<P>You&#146;ll be presented with the <B>ftp</B> prompt, where you enter special <B>ftp</B> commands. To get a list of available commands, type a question mark (<B>?</B>) or <B>help</B> at the prompt:</P>

<!-- CODE SNIP //-->

<PRE>

     ftp&gt; ?

     or

     ftp&gt; help

</PRE>

<!-- END CODE SNIP //-->

<P>A list of the most common FTP commands is contained in Table 9.3.

</P>

<TABLE WIDTH="100%"><CAPTION><B>Table 9.3</B> Common FTP Commands

<TR>

<TH WIDTH="30%" ALIGN="LEFT">Command

<TH WIDTH="70%" ALIGN="LEFT">Result

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD><B>ascii</B>

<TD>Use ASCII as the file-transfer type.

<TR>

<TD><B>bell</B>

<TD>Ring the bell when file transfer is complete.

<TR>

<TD><B>binary</B>

<TD>Use binary as the file-transfer type.

<TR>

<TD><B>bye</B> or <B>quit</B>

<TD>Terminate <B>ftp</B> session.

<TR>

<TD><B>cd</B>

<TD>Change directory on the remote machine.

<TR>

<TD VALIGN="TOP"><B>close</B>

<TD>End <B>ftp</B> connection to remote computer but keep local <B>ftp</B> program running.

<TR>

<TD><B>delete <I>filename</I></B>

<TD>Delete <I>filename</I> on remote computer.

<TR>

<TD><B>get <I>filename</I></B>

<TD>Get <I>filename</I> from the remote machine.

<TR>

<TD VALIGN="TOP"><B>get <I>filename1 filename2</I></B>

<TD>Get <I>filename1</I> from the remote machine and save it locally as <I>filename2</I>.

<TR>

<TD><B>help</B>

<TD>List available commands.

<TR>

<TD><B>mput <I>filename</I></B>

<TD>Copy the local <I>filename</I> to the remote machine.

<TR>

<TD><B>pwd</B>

<TD>List the current directory on the remote machine.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P>It&#146;s simple to download files from a remote machine with <B>ftp</B>. Let&#146;s say we want to grab some files from the machine named <B>mn.kevin.com</B>. (No, this isn&#146;t a real machine.) Assuming that this is a machine on the Internet that supports anonymous FTP&#151;and our fictional machine does, of course&#151;you would merely specify its name on the command line:</P>

<!-- CODE SNIP //-->

<PRE>

     gilbert:/$ ftp mn.kevin.com

</PRE>

<!-- END CODE SNIP //-->

<P>If the connection goes through, you&#146;ll receive a verification message, along with a login prompt. Because this is anonymous FTP, use <I>anonymous</I> as a login name:</P>

<!-- CODE SNIP //-->

<PRE>

     Name: anonymous

</PRE>

<!-- END CODE SNIP //-->

<P>You&#146;ll then be asked for a password. Some systems require you to supply your electronic-mail address, while others require <I>guest</I>. Use either. You&#146;ll then be presented with an <B>ftp</B> prompt.</P>

<P>The remote system has been set up to give you limited access, which means that your maneuverability is very limited and the files you want are usually close at hand. If you need to change to another directory, do so with the UNIX <B>cd</B> command.</P>

<P>Before embarking on the great file quest, you should know something about the files you&#146;re downloading. If they are straight C files in uncompressed, ASCII form, you can download them using the default file-transfer settings. Most larger files, especially binary files, are stored in compressed form so they take less time to transfer.</P>

<P>These compressed files end with <I>.Z</I>, <I>.z</I>, <I>.tgz</I>, <I>.zip</I>, or <I>.gz</I>. so they are instantly recognizable. To download compressed files, you must change to binary mode, because you&#146;re downloading binary files. Do so with:</P>

<!-- CODE SNIP //-->

<PRE>

  ftp&gt; binary

</PRE>

<!-- END CODE SNIP //-->

<P>Once you are placed in the correct directory containing the file to be downloaded, start the download process with the <B>get</B> command:</P>

<!-- CODE SNIP //-->

<PRE>

     ftp&gt; get filename

</PRE>

<!-- END CODE SNIP //-->

<P>As you download the file, there will be a prompt on the system, and you won&#146;t be able to enter any keystrokes.

</P>

<P>After the file has been transferred successfully, you&#146;ll be given a message similar to the following:</P>

<!-- CODE SNIP //-->

<PRE>

     Transfer complete

</PRE>

<!-- END CODE SNIP //-->

<P>You may also be told the size of the file and the transfer time.

</P>

<P>Because you&#146;re through with your file needs, close the connection with the <B>bye</B> command:</P>

<!-- CODE SNIP //-->

<PRE>

     ftp&gt; bye

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading17"></A><FONT COLOR="#000077">What do I Do with the File?</FONT></H4>

<P>If you download an ASCII file, you can view it using any editor, including <B>vi</B> or <B>emacs</B>. If it&#146;s a sourcecode file, you can compile it for use on your own system; we explain the process in Chapter 10. If you&#146;ve downloaded a compressed binary file, you will have to uncompress it (and perhaps unarchive it) at the command line using <B>uncompress</B>, <B>unpack</B>, <B>tar</B>, or <B>gzip</B>&#151;things you learned about in Chapter 4.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="423-427.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="430-432.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -