ABSTRACT

This chapter describes how some basic file operations can be performed in Linux. The basic file operations involve displaying all or part of a file's contents, renaming a file, moving a file to another file, removing a file, determining a file's size, comparing files, combining files and storing them in another file, appending new contents at the end of a file, and printing files. Linux provides several commands that can be used to perform these operations. The chapter covers the following commands and primitives: >, >>, ^, ~, [ ], *, ?, cancel, cat, cksum, cp, crc32, diff, diff3, head, lp, lpc, lpq, lpr, lprm, lpstat, lptest, less, ls, md5sum, more, mv, nl, patch, pg, pr, rm, sdiff, shasum, tail, uniq, vimdiff, and wc. It illustrates how the uniq command works. The uniq sample command shows that only consecutive duplicate lines are considered duplicate. The uniq -c sample command shows the line count for every line in the file.