Combining Files with cat
-E display line ends
-n number lines
-s minimize blank lines
-T display special characters
Joining Files by Field with join
-o FORMAT
Merging Lines with paste
Converting Tabs to Spaces with expand
-t num (default spacing value is 8, change it with value num)
Displaying Files in Octal with od
Sorting Files with sort
-f ignore case
-M month sort
-n numeric sort
-r reverse sort order
-k field sort field
od listing1.2.txt
sort -k 3 listing1.1.txt
Slide 3
File-Transforming Commands (2)
Breaking File into Pieces with split
-b size split by bytes
-C=size split by bytes in line-sized chunks
-l lines split by number of lines
Translating Characters with tr
-t truncates SET1 to the size of SET2
-d deletes the characters from SET1
Converting Spaces to Tabs with unexpand
-t num sets tab spacing to once every num characters
Deleting Duplicate Lines with uniq
Reformatting Paragraphs with fmt
-width, -w, width, --width=width
Numbering Lines with nl
-b style body numbering style
-h style header and footer numbering style
-f style " "
-d=code page separator
-p line-number options for new pages
-n format number format
Style codes: t, a, n, pREGEXP
nl -b a buggyprog > numbered-buggyprog.txt
Slide 5
File-Formatting Commands (2)
Preparing a File for Printing with pr
-numcols generate multicolumn output
-d generate double-spaced output
-F, -f use form feeds
-l set page length
-h text set the header text
-t omit header
-o chars set left margin and page width
Viewing the Starts of Files with head
-c num specify the number of bytes
-n num specify the number of lines
Viewing the Ends of Files with tail
-f track a file
--pid=pid stop tracking on program termination
Paging through Files with less
Slide 7
File-Summarizing Commands
Extracting Text with cut
-b lists by byte
-c lists by character
Obtaining a Word Count with wc
-l, -w, -c, -m limit to newline, words, bytes, characters count
-L maximum line lenght