How to Read Portions of Files with Unix for Mac OS X


show more Reading portions of files provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users show less
please wait ...

Reading portions of files

In this movie, we'll look at two other useful commands for reading files. They are head and tail. The difference is with both of these commands, they will read just a portion of the file. head displays the lines from the beginning of the file. This is useful for just peeking at the start of the file, let's say viewing the first ten lines. tail does the same thing but in reverse. It displays lines from the end of a file. This comes in very handy, when you want to look at files like access logs or error logs where the latest entries in the file will be added to the end. So for example, you can view the tail of a web server's access log to see the most recent requests made to the web server.

tail also has a very useful option, the f option which allows us to follow the file. It reads the tail of the file normally, but then instead of exiting back to the command prompt, it will watch for changes to the file. Whenever a new line is added, it will show us that line. We are following...

Reading portions of files
Video duration: 3m 27s 6h 35m Beginner

Viewers:

Reading portions of files provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users

Subject:
IT
Software:
Mac OS X Unix
Author:
please wait ...