![Page 1: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/1.jpg)
Chapter 9
Basic File Processing
![Page 2: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/2.jpg)
Displaying File Contents
• cat, cat w/append• tac• nl• pr• more• less• head• tail
![Page 3: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/3.jpg)
Table 9.1 Some Useful less Commands
![Page 4: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/4.jpg)
Table 9.1 More less Commands
![Page 5: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/5.jpg)
File Location Commands
• cp• mv• ln• rm• mkdir• rmdir
![Page 6: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/6.jpg)
Figure 9.1 Current directory before and after command cp temp temp.bak
![Page 7: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/7.jpg)
Figure 9.2 Current directory before and after command mv temp backups/temp.old
![Page 8: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/8.jpg)
Figure 9.3 Current directory before and after command
rm temp backups/temp.old
![Page 9: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/9.jpg)
File Statistics Commands
• ls –l• wc
![Page 10: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/10.jpg)
Comparing Files
• cmp, zcmp • diff, zdiff – Output is a set of commands that can be used
with the ed (or vi) editor to convert the first file into the second file
– Often used to send out upgrades
![Page 11: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/11.jpg)
Table 9.2 File Conversion Instructions Produced by diff
![Page 12: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/12.jpg)
Removing Repeated Lines
• uniq command• Intended for use on sorted files• Produces an output file with only one copy of
any repeated consecutive lines
![Page 13: Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail](https://reader033.vdocuments.us/reader033/viewer/2022051316/56649f155503460f94c2a3ff/html5/thumbnails/13.jpg)
Table 9.3 Printing