Computer Files

advertisement
Computer Files
• Stored on disks, CDs, tapes, in memory.
• Types of files: plain text, formatted (.doc
.xls etc…), binary (executable).
• A disk has a directory structure.
• Top level (root) directory, with
– Files in it
– Subdirectories in it.
1
UNIX File Commands
•
•
•
•
•
•
•
ls
cd
mkdir
rmdir
mv
cp
rm
-- list files.
-- change directory.
-- make new directory.
-- delete directory.
-- move a file.
-- copy a file.
-- remove (delete) a file.
2
Using Telnet
•
•
•
•
A protocol (set of rules)
Connects your machine to another.
Can be used to log in to a machine.
Uses TCP to correct errors
3
Uses of Telnet
• Logging in to remote machines
• Can connect to other services, but the logins
won’t always work.
– Web servers -- www.umd.edu 80
• GET /index.html
– ftp servers
-- ftp.sf.net 21
– Echo servers -- wolfe.umd.edu 12345
4
Intro to File Transfers
• Name – ftp (File Transfer Protocol)
• Also lets you connect to machines
– Client-Server architecture
• The command is called ftp
– ftp “listens” on port 21,
• Lets you transfer/download/upload files like
– MP3’s, pictures, letters, programs…
5
Transfer Modes
• There are two transfer modes – text and
binary.
– Text is for files like funfile.
– Binary is for files like music, pictures, Word
documents, computer programs.
• Not using binary can cause subtle errors,
such as 1out of 40 pictures not working.
6
Data Transfers
• In text mode, files may be altered to work
with the recipient machine.
• Binary files are not altered at all.
• Typing bin changes to binary mode.
• Typing asc changes to text mode.
7
Using ftp 1
• The command to use ftp is -- ftp
• You can type the host (server) name in the
command prompt, or at the ftp> prompt.
• Some sites are anonymous, no login
required and give you limited access.
• Some sites require a login and password.
8
Ftp Commands
• Get to move a file to your computer.
• Put to move a file from your computer.
• You are in a certain directory location on
both machines. You can use cd and lcd
(local change dir) to move around in the
directory tree. You can use ls to see the
contents of the remote directory.
• !<command> does a local command.
9
Ftp Commands 2
•
•
•
•
•
•
ls -- list files in the remote directory.
cd -- change remote directory.
cdup -- remote directory up one level.
lcd -- change local directory.
? Or help -- list helpful keywords.
close or quit -- disconnect from the server.
10
Getting files
•
•
•
•
•
•
recv <filename>
recv <filename> <new-filename>
get <filename>
get <filename> <new-filename>
mget <list_of_remote_files>
get and recv do the same thing.
11
Sending Files
•
•
•
•
•
•
send <filename>
send <filename> <new_filename>
put <filename>
put <filename> <new_filename>
mput <list_of_local_files>
send and put do the same thing.
12
Ftp speed
• Depends on
–
–
–
–
–
–
Your connection speed.
Server connection speed.
Your computer’s load.
The server load.
General Internet traffic.
Restraints your ISP puts on you.
13
Other ways to transfer
• Kermit, z-modem, x-modem – these only
send one way.
• Other ftp programs within your computer.
• Downloading files within a web browser.
• Using special terminal/communications
programs with special file transfer code.
• Example: Wsftp on WAM NT machines.
14
Anonymous ftp
• Some sites don’t require logins
– Similar to downloading from a website without
logging in .
•
•
•
•
Login as anonymous
Send email address as password
You may not get access to everything.
Example: ftp ftp.sf.net
15
Anonymous ftp
• Anonymous logins not available always.
• You cannot always write files to the server.
• However, there may be an “incoming” or
“uploads” directory where you can post
files.
16
Victor
•
•
•
•
•
Online card catalog
Type telnet victor
No login needed
Type pac (public access catalog)
Choose terminal type
– vt100 usually works
• //exit hangs up
17
Databases on Victor
•
•
•
•
•
•
•
USM campus catalogs
Other libraries in MD.
Out-of-state libraries.
Periodicals index
Other kinds of databases.
2 = USM catalogs
59 = UMCP catalogs
18
Some types of searches
• Name search -- search for an author or
editor or books on an author.
• Word search -- search for strings of words
such as in a title.
• Subject Word -- search for keywords only.
19
Victor Searches
• Browse -- try to match similar keywords,
numbers or series names.
– Title search tries to match a title if it can.
– Series search is used for journals or series of
technical books. (eg. Lecture notes in
mathematics.)
– Call number search is used if you know the
approximate call number. (eg. Qa403)
20
Newsgroups
• rn – To start newsreader at % prompt
– Other readers: trn tin nn readnews
– Google groups for WWW access.
• May ask if you want to subscribe.
– Type N generally
– Type y if you want to subscribe then enter when
the [$^.Lq] option comes up.
• Two levels: group and article selection.
21
Newsgroup Selection
• Ask if you want to read a group [ynq]
– Y or space means read, n no/next, q quit rn.
• Type g groupname to start reading a group.
– Eg. g alt.test
• u means unsubscribe a group.
• ! – execute shell command.
• /<pattern> search for group containing this
pattern.
22
Article Selection Level 1
•
•
•
•
•
space – read next article
q – quit this group.
^N – scan for next article with same title.
n – read next article.
p – read previous article.
23
Article Selection Level 2
•
•
•
•
•
/<pattern>/h – scan for pattern in header.
/<pattern>/a – scan for pattern in article.
F or f – send a reply post.
R or r – reply to poster in email.
s file – save this article to a file.
– Hit enter when asked about mailbox format.
– It will be saved to your News directory.
24
Pnews 1
• Pnews – post an article to a newsgroup.
• Asks for newsgroup(s): List them.
– Eg. alt.test
• Distribution
– Choose any, (UM is good for alt.test)
• Title/Subject: Enter the subject.
• Are you sure? Y
25
Pnews 2
• Prepared file to include?
– Useful if you pre-write using a good editor.
• Editor: hit enter (should start pico).
• Write the message and hit ^X when done.
• Options – Send, Abort, Edit, List
– Choose s for send if you’re happy with the post.
26
Download