Understanding Error Messages

When you encounter a problem on a Unix-like system such as Linux, you must read the error message. Unlike messages from other operating systems, Unix errors usually tell you exactly what went wrong.

Most Unix programs generate and report the same basic error messages, but there can be subtle differences between the output of any two programs. Here is an example that you'll certainly encounter in some form or other (the error message is in boldface):

$ ls /dsafsda
ls: /dsafsda: No such file or directory

There are three components to this message:

  • The program name, ls. Some programs omit this identifying information, which can be annoying when you are writing shell scripts, but it's not really a big deal.

  • The filename, ...

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.