From 04dcae7f3fc846da30c786a8f4f061b31f145a23 Mon Sep 17 00:00:00 2001 From: Alan Hicks Date: Sat, 6 Feb 2010 14:50:41 -0500 Subject: Chapter 15 (mostly) complete. Still need to decide on including NNTP content or not. --- chapter_15.xml | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 212 insertions(+), 1 deletion(-) (limited to 'chapter_15.xml') diff --git a/chapter_15.xml b/chapter_15.xml index 7071a69..ea49478 100644 --- a/chapter_15.xml +++ b/chapter_15.xml @@ -3,7 +3,7 @@ "/usr/share/xml/docbook/xml-dtd-4.5/docbookx.dtd"> -Basic Networking Commands +Basic Networking Utilities So you've finally managed to setup your network connection, now what? @@ -394,15 +394,107 @@ retrieve this information is a handy skill.
ftp + +The simplest FTP client included with Slackware is named simply, +ftp(1) and is a reliable if somewhat simple +means of sending and retrieving data. ftp +connects to an FTP server, asks for your username and password, and +then allows you to put or get data to and from that server. +ftp has fallen out of favor with more +experienced users do to a lack of features, but remains a handy tool, +and much of the documentation you see online will refer you to it. + + + +Once an FTP session has been initialized, you'll be placed at a prompt +somewhat like a shell. From here you can change and list directories +using the "cd" and "ls" commands, just like a shell. Additionally, you +may issue the "put" command to send a file to the server, or a "get" +command to retrieve data from the server. If you're connecting to a +public FTP server, you'll want to use the "anonymous" username and +simply enter your e-mail address (or a fake one) for the password. + + +darkstar:~# ftp ftp.osuosl.org +Name (ftp.osuosl.org:alan): anonymous +331 Please specify the password. +Password: secret +230 Login successful. +Remote system type is UNIX. +Using binary mode to transfer files. +ftp> cd pub/slackware/slackware-current/ +250 Directory successfully changed. +ftp> get ChangeLog.txt +local: ChangeLog.txt remote: ChangeLog.txt +200 PORT command successful. Consider using PASV. +150 Opening BINARY mode data connection for ChangeLog.txt (33967 +bytes). +226 File send OK. +33967 bytes received in 0.351 secs (94 Kbytes/sec) +ftp> bye +221 Goodbye. +
ncftp + +ncftp(1) (pronounced nick-f-t-p), is a more +feature rich successor to ftp, supporting +tab completion and recursive retrieval. It automatically connects to a +server as the anonymous user, unless you specify a different username +on the commandline with the -u argument. The primary +advantage over ftp is the ability to send +and retrieve multiple files at once with the "mput" and "mget" +commands. If you pass the -R argument to either of them, +they will recursively put or get data from directories. + + +darkstar:~# ncftp ftp.osuosl.org +Logging in... +Login successful. +Logged in to ftp.osuosl.org. +ncftp / > cd pub/slackware/slackware-current +Directory successfully changed. +ncftp ...ware/slackware-current > mget -R isolinux +isolinux/README.TXT: 4.63 kB 16.77 kB/s +isolinux/README_SPLIT.TXT: 788.00 B 5.43 kB/s +isolinux/f2.txt: 793.00 B 5.68 kB/s +isolinux/initrd.img: 13.75 MB 837.91 kB/s +isolinux/iso.sort: 50.00 B 354.50 B/s +isolinux/isolinux.bin: 14.00 kB 33.99 kB/s +isolinux/isolinux.cfg: 487.00 B 3.30 kB/s +isolinux/message.txt: 760.00 B 5.32 kB/s +isolinux/setpkg: 2.76 kB 19.11 kB/s +ncftp ...ware/slackware-current > bye + +
lftp + +The last client we're going to look at is +lftp(1). Like +ncftp, it supports tab completion and +recursive activity, but has a more friendly license. Rather than user +"mget" and "mput", all recursive operations are handled with the +"mirror" command. "mirror" has many different options available, so +I'll have to refer you to the man page and the built-in "help" command +for complete details. + + +darkstar:~# lftp ftp.osuosl.org +lftp ftp.osuosl.org:~> cd /pub/slackware/slackware-current +cd ok, cwd=/pub/slackware/slackware-current +lftp ftp.osuosl.org:/pub/slackware/slackware-current> mirror isolinux +Total: 2 directories, 16 files, 1 symlink +New: 16 files, 1 symlink +14636789 bytes transferred in 20 seconds (703.7K/s) +lftp ftp.osuosl.org:/pub/slackware/slackware-current> bye + +
@@ -410,11 +502,130 @@ retrieve this information is a handy skill.
NNTP Clients + +Once upon a time when the Internet was young, before the World Wide Web +was invented and no one had heard of hyperlinks, everyone retrieved +their news and information through a service known as Usenet using the +NNTP protocol. It remains today a useful knowledge base of information +on an incredible variety of subjects, but if you wish to access this +information, you're going to need a proper client. Slackware includes +a number of NNTP clients with both console and graphical interfaces, +but we'll only detail the console tools here. Popular graphical news +readers include knode and +pan. + + +
tin + +
+ +
slrn + +
+
rsync + +Ready to see something cool? Have you ever found yourself needing just +a handful of files from a large directory, but you're not entirely sure +which files you already have and which ones you need? You can download +the entire directory again, but that's duplicating a lot of work. You +can pick and chose, manually check everything, but that's very tedious. +Perhaps you've downloaded a large file such as an ISO, but something +went wrong with the download? It doesn't make sense that you should +have to pull down the entire file again if only a few bits have been +corrupted. Enter rsync(1), a fast and +versatile copying tool for local and remote files. + + + +rsync uses a handful of simple, but very +effective techniques to determine what needs to be changed. By checking +file size and time stamps, it can determine if two files are different. +If something has changed, it can determine what bytes are different, +and simply download that handfull of data rather than an entire file. +It is truly a marvel of modern technology. + + + +In its simplist form, rsync connects to an +rsync protocol server and downloads a list of files and directories, +along with their sizes, timestamps, and other information. It then +compares this to the local files (if any) to determine what it needs to +transfer. Only files that are different will be synced. Additionally, +it breaks up large files into smaller chunks and compares those chunks +using a quick and simple hash function. Any chunks that match are not +transferred, so the amount of data that must be copied can be +dramatically reduced. rsync also supports +compression, verbose output, file deletion, permission handling, and +many other options. For a complete list, you'll need to refer to the +man page, but I've included a small table of some of the more common +options. + + + +rsync Arguments + + + Argument + Explaination + + + + -v + Increased verbosity + + + -c + Checksum all files rather than relying on file size and timestamp + + + -a + Archive mode (equivilant to -rlptgoD) + + + -e + Specify a remote shell to use + + + -r + Recursive mode + + + -u + Update - skip files that are newer on the receiving end + + + -p + Preserve permissions + + + -n + Dry-run - perform a trial run without making any changes + + + -z + Compress - handy for slow network connections + + + +
+ + +Due to the power and versatility of rsync, +it can be invoked in a number of ways. The following two examples +connect to an rsync protocol server to retrieve some information and to +another server via ssh to encrypt the transmission. + + +darkstar:~# rsync -avz rsync://ftp.osuosl.org/pub/slackware/slackware-current/ \ +/src/slackware-current/ +darkstar:~# rsync -e ssh ftp.slackware.com:/home/alan/foo /tmp/foo + +
-- cgit v1.2.3