Red Hat NETSCAPE MANAGEMENT SYSTEM 6.0 - CUSTOMIZATION User Manual Page 275

  • Download
  • Add to my manuals
  • Print
  • Page
    / 300
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 274
17.4 Identifying and Working with File Types 263
head <filename>
Head can be useful, but because its limited to the rst several lines, you wont know how long the
le actually is. By default, you can only read the rst10linesofale, although we can specify the
numbertoseemorebytyping:
head -20 <filename>
Read head’s man page (man head) for more information. Youll probably nd that less or more
are more helpful, because you can page through the le if you nd that the information youre look-
ing for is further into the le than you originally thought.
The tail Command
The reverse of head (obviously), is tail.With(tail), you can review the last 10 lines of a le.
The cat Command
The command cat, short for concatenation, will dump the contents of the entire le on the screen.
Using cat can be handy if the le is fairly short, such as when we created sneakers.txt.Butifa
le is fairly long, it will easily scroll past you on the screen, since cat displays the whole le.
The grep Command
The grep command is pretty nifty for nding specic character strings in a le. Lets say we want to
nd every reference we made to coffeein the le sneakers.txt, which we created in our login
directory. We could type:
grep coffee sneakers.txt
andwewouldseeeverylineinwhichthewordcoffeecould be found.
Tip: Unless otherwise specied, grep searches are case sensitive. That means that
searching for Coffee is different than searching for coffee.Soamonggreps options is -i,
which allows you to make a case-insensitive search through a le. Read the grep man
page for more about this command.
Page view 274
1 2 ... 270 271 272 273 274 275 276 277 278 279 280 ... 299 300

Comments to this Manuals

No comments