*, ? And [ …] . Any single character ^ beginning of a line $ end of the line
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
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
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
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
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
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
uniq names ◦ finds the unique lines uniq –d names ◦ tells you the duplicate lines uniq –c names ◦ counts the number of occurrences