130 likes | 207 Views
This guide explores essential file processing commands such as `cat`, `tac`, `cp`, `rm`, `less`, and more. Learn to display, move, compare, and convert files efficiently using commands like `nl`, `diff`, `uniq`, and more. Enhance your file management skills with practical examples and instructions.
E N D
Chapter 9 Basic File Processing
Displaying File Contents • cat, cat w/append • tac • nl • pr • more • less • head • tail
File Location Commands • cp • mv • ln • rm • mkdir • rmdir
Figure 9.1 Current directory before and after command cp temp temp.bak
Figure 9.2 Current directory before and after command mv temp backups/temp.old
Figure 9.3 Current directory before and after command rm temp backups/temp.old
File Statistics Commands • ls –l • wc
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
Removing Repeated Lines • uniq command • Intended for use on sorted files • Produces an output file with only one copy of any repeated consecutive lines