Data base Management - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Data base Management

Description:

grep n string filename. Reverse the sense; display all lines without the string. grep v string filename. Select lines having a pattern ... grep pattern file3 ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 11
Provided by: Kami47
Category:
Tags: base | data | grep | management

less

Transcript and Presenter's Notes

Title: Data base Management


1
Data base Management
  • awk
  • grep
  • ltlt
  • bc

2
awk
  • The name of the awk is derived from the names of
    the programmers who wrote it, Aho, Weinberger,
    and Kernighan
  • The awk is useful for information retrieval, data
    manipulation, and report writing
  • So awk utility can be used to select and print
    specific field e.g.,
  • Who awk print 1

3
Select lines and print fields
  • Awk can select record based on the presence of a
    specified pattern
  • awk /string/ print 3 filename
  • 0 denotes all fields of a record, I.e, the
    entire line
  • awk /string/ print 0 filename

4
Changing the field delimiter
  • awk F print 2 /etc/passwd

5
grep
  • grep searches for lines containing target string
  • grep string filename
  • Search through all files
  • grep string /
  • List name of the files that contain matches
  • grep l string /
  • Ignore the case
  • grep i string filename

6
grep
  • Identify the line number for each match
  • grep n string filename
  • Reverse the sense display all lines without the
    string
  • grep v string filename
  • Select lines having a pattern at the beginning of
    the line
  • grep string filename

7
Task 1
  • 1. What command do you enter to print the fourth
    field of file1?
  • 2. Using awk, write a command line that functions
    like the following grep command
  • grep pattern file3

8
Here Document
  • A term used for redirecting multiple lines
  • cat gtgt /.profile ltltEND
  • banner Welcome
  • date
  • END

9
Performing Arithmetic
  • Basic Calculator
  • bc ltentergt
  • 57
  • 12
  • 57
  • 35

10
Performing Arithmetic
  • The (()) command
  • echo ((57))
  • 12
  • echo ((57))
  • 35
Write a Comment
User Comments (0)
About PowerShow.com