Looking Inside Files

You've learned how to manipulate files and directories, so now it's time to find out what kind of information is contained within these files and look inside the files.

Task 7.1: Using file to Identify File Types

One of the most undervalued commands in UNIX is file, which is often neglected and collecting dust in some corner of the system. The file command is a program that can easily offer you a good hint as to the contents of a file by looking at the first few lines.

Unfortunately, there is a problem with the file command: It isn't 100% accurate. The program relies on a combination of the permissions of a file, the filename, ...

Get Sams Teach Yourself UNIX® in 24 Hours Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.