Essential Linux

Chapter 10: If it doesn't work

Overview

Despite the best preparation and intention in the world, there are times when a command either does not work or does not function as expected. This can be a frustrating and sometimes frightening experience. Here are some common problems and suggestions for dealing with them.

The system returns "cannot open file"

  • The directory containing the command is not included in the PATH variable. Either change it or specify the full file name.

  • The command does not exist. Check the name for any spelling mistakes or letters in the wrong case. Linux commands are case sensitive Ls and Is refer to two separate files.

  • The file permissions are against you and need changing. This is very common after writing a script and then trying to execute it. The standard write permissions do not allow the file to be executed. Use chmod to change them if you are the owner or superuser.

  • You may be working using a restricted shell such as rsh. Log in as another user that uses the full shell, or ask the system administrator to change your login shell.

  • Use find to search for the command it may be in a different directory. If necessary, specify the full path name to access it or change the PATH variable.

The system returns "unrecognized option"

  • Check the options for any spelling mistakes. A common mistake is to include dashes when the command does not expect them, as with tar. Try the command, if possible, with...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Ball Valves
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.