cis52 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CIS52 PowerPoint Presentation
Download Presentation
CIS52

Loading in 2 Seconds...

play fullscreen
1 / 29

CIS52 - PowerPoint PPT Presentation


  • 374 Views
  • Uploaded on

CIS52 Week 3 Agenda User Communication System V Manual Sorting Searching File Compression Miscellaneous Utilities User Communication write talk mesg mail biff finger write sends a message to another logged on user syntax: write destination-user [terminal]

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CIS52' - albert


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cis52

CIS52

Week 3

agenda
Agenda
  • User Communication
  • System V Manual
  • Sorting
  • Searching
  • File Compression
  • Miscellaneous Utilities
user communication
User Communication
  • write
  • talk
  • mesg
  • mail
  • biff
  • finger
write
write
  • sends a message to another logged on user
  • syntax: write destination-user [terminal]

one or more lines of text

^d

  • example: write n01

Having a bad Unix day?

^d

slide5
mesg
  • allows write and talk to send messages to you (or not)
  • example: mesg n

mesg y

slide6
mail
  • Modeled after typical postal system
  • Unix post office has file for each user
    • /usr/spool/mail/n01
  • each user also has a personnel mailbox called mbox. (created in users home directory)
  • when you read mail, it is moved to your postbox.
slide7
mail
  • Mail consists of
    • heading and body
  • heading
    • to
    • subject
    • cc
    • bcc
  • body is your message.
slide8
mail
  • Two modes: compose and command
  • type mail at shell prompt to enter command mode.
  • type mail user-id to enter compose mode

end compose mode with ^d (type a period in linux)

~ allows you to shell out to another command

      • ~v
      • ~r myfile
mail command options
Mail command options
  • q leave mail
  • r reply to originator
  • R reply to everyone on distribution list
  • d delete current message
  • ! Shell out (ie, !date)
  • ? Help
  • h display list of message headers
slide10
biff
  • Toggle switch to alert you when mail has been sent
  • biff y
  • biff n
  • BSD utility .. Not on many systems
slide11
talk
  • two way conversation with split screen visable for both
  • example: talk n01
  • lines of message
  • ^d

(on some systems, the del key)

finger
finger
  • displays info about a user
  • login id, name, tty, idle time, log in status
  • example: finger n01
  • Will also display contents of a .plan file (if in the targets home directory
man pages
Man Pages
  • 8 Sections
  • At least 3 parts to each page
    • name and purpose
    • synopsis (command usage, arguments)
    • description
  • Optional
    • diagnostics, bugs, examples
man pages14
Man Pages
  • Development of the man pages
    • nroff utility for low resolution devices
      • terminals
      • dot matrix printers
      • line printers
    • troff utility for high resolution devices
      • lasers and phototypsetters
system v manual sections
System V Manual Sections
  • 1. Commands and application programs
  • 2. System Calls
  • 3. Library Functions
    • (BSD .. Special files, drivers)
  • 4. File Formats
    • (BSD .. File formats, sys admin)
system v manual sections16
System V Manual Sections
  • 5. Miscellaneous
  • 6. Games
  • 7. Special Files
    • (BSD .. Miscellaneous)
  • 8. System Maintenance
sorting
Sorting
  • Options
    • f upper and lower case considered the same
    • r reverse order (ie, z to a)
    • u duplicate entries are eliminated from output
    • k defines the field to start the sort comparisons. Count starts with 1 (replace k with a number)
    • b ignores blanks
what is a field
What is a ‘field’
  • Contains ascii data
  • delimited by ‘whitespace’
  • whitespace is:
    • tab
    • blank
    • carriage return
  • example
  • the day the earth stood still
sorting20
Sorting
  • Examples
    • sort myfile
    • sort -r myfile
    • sort file1 file2
    • sort file1 file2 > file3
    • sort +1 myfile
      • (skip a field, then start comparisons)
sorting21
Sorting
  • sort +1 -2 myfile
    • skip a field (start sort in field number 2)
    • end sort at end of field 2
  • sort -b +2.1 -3
    • -b ignore blanks
    • +2 skips first two fields
    • .1 skip 1 character in next field
    • 3 ends sort key at end of field 3
searching with grep
Searching with grep
  • searches standard in for a pattern
  • sends all lines with that pattern to std out
  • options
    • -v ignore lines which do NOT have pattern
    • -i ignore case
    • -c count lines
    • -n print line numbers
    • -l print file names only
slide23
grep
  • Examples
    • grep aardvark animalfile
    • grep -v aardvark myfile
    • grep -vi minnie myfile
    • who | grep minnie
    • grep * data
    • grep -l ‘[D,d]ata’ *
file compression
File Compression
  • compress
    • examines file, searches for repeated patterns
    • recodes file and renames with .Z
  • uncompress
    • restores compressed file to original form
    • removes .Z
  • zcat
    • sends content of compressed file to std out.
compression
compression
  • Compress -v myfile
    • myfile.Z (v prints name of file % % compression)
  • cat myfile.Z
  • zcat myfile.Z
  • uncompress myfile.Z
miscellaneous utilities
Miscellaneous Utilities
  • File displays type of file
    • file file1.Z
  • diff displays difference between two files
    • diff myfile yourfile
  • uniq displays unique lines
    • assumes file is sorted
    • uniq myfile
tr translate
tr (translate)
  • tr is a filter and does not allow filename to be entered as an argument
  • tr must get its data from std in
    • either from <file or from a pipe
  • tr a A <myfile
  • who | tr a A
  • who | tr abc ABC
  • who | tr ‘[a-z] [A-Z]’
feedback
Feedback

What do the following commands do?

  • mail minnie < temp
  • who | mail minnie
  • compress myfile | mail minnie
  • mesg n
  • sort -r myfile
  • sort +3 myfile
feedback29
Feedback
  • grep -v clinton
  • grep abc* temp
  • grep unix lab[1-6]
  • tr a B myfile
  • who | ls
  • who > wc -l
  • woof y