Presentation is loading. Please wait.

Presentation is loading. Please wait.

 *, ? And [ …] . Any single character  ^ beginning of a line  $ end of the line.

Similar presentations


Presentation on theme: " *, ? And [ …] . Any single character  ^ beginning of a line  $ end of the line."— Presentation transcript:

1

2  *, ? And [ …] . Any single character  ^ beginning of a line  $ end of the line

3  cut –c2-10 filename ◦ Will extract characters 2 – 10 from each line of a file  cut –c5- filename ◦ Will extract from character 5 to the end of each line  cut –d: -f1 /etc/passwd ◦ “:” is the delimiter ◦ f specifies which field

4  paste names numbers ◦ matches one line of a file with that of the other  paste –d’+’ names addresses numbers ◦ uses + as the delimiter  paste –s names ◦ will paste all the lines as one line

5  create the intro paragraph  use sed to make changes ◦ sed ‘s/Unix/UNIX/’ intro  sed –n ‘1,2p’ intro ◦ tells sed to only print the lines specified  sed ‘1,2d’ intro ◦ tells sed to delete lines 1 and 2  sed ‘/UNIX/d’ intro ◦ delete all lines containing UNIX

6  tr translates things  tr e x < intro ◦ changes all the e’s to x’s  tr ‘[a-z]’ ‘[A-Z]’ < intro ◦ puts everything to uppercase  tr : ‘\12’ ◦ replaces : with a newline Octal Values Backspace 10 Tab11 Newline12 Linefeed12 Carriage Return15

7  sort names  sort –u names ◦ eliminates duplicates  sort –r names ◦ reverse the sort order  sort names –o sorted_names ◦ sends the result to a file  sort –n data ◦ numeric sort

8  sort +1n data ◦ skips the first field  sort +2n –t: /etc/passwd ◦ t tells it what the delimiter is if it is not a tab

9  uniq names ◦ finds the unique lines  uniq –d names ◦ tells you the duplicate lines  uniq –c names ◦ counts the number of occurrences


Download ppt " *, ? And [ …] . Any single character  ^ beginning of a line  $ end of the line."

Similar presentations


Ads by Google