UNIX For Dummies [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

UNIX For Dummies [Electronic resources] - نسخه متنی

John Levine, Margaret Levine Young

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Chapter 24: “My Computer Hates Me”


Overview


In This Chapter

Lots of error messages

What they mean

What to do about them

Question: You type a command. UNIX says something incomprehensible. What does it mean? What should you do?

Answer: Look in this chapter for the error message. We tell you what the message means and what you can do to fix the problem.

Most error messages start with the name of the command you tried to use. If you want to use the cp command to copy a file, for example, but you spell the name of the file incorrectly, cp can’t find a file with the name you typed, so it says something like this:

cp: No such file or directory
At the beginning of the line is the name of the command that failed to work. After the colon comes the UNIX error message — UNIX’s attempt to explain the problem.

This chapter contains the most common error messages, in alphabetical order. In some of our explanations, we refer to things called arguments, not because we are feeling argumentative but because that’s the technical name for the information you type on the command line after the command. Suppose that you type this line:


cp proof.that.elvis.lives save

cp is the command, proof.that.elvis.lives is the first argument, and save is the second argument. You can have lots of arguments on the line: The number you need depends on the command you use (cp requires two). Type a space between arguments.
UNIX also has things called options, which tell the command how you want it to work. Options always start with a hyphen (-). Suppose that you type this line:


ls -l

The -l tells the ls command how you want it to display the files. Options don’t count as arguments. If you type this line:


ls -l *

the -l is an option, and * is the first (not the second) argument.

This stuff is nit-picky, but, if UNIX complains about a particular argument or option, knowing exactly which item it doesn’t like comes in handy.

And now (drum roll, please), the error messages!


Arg list too long


Meaning: The list of arguments (stuff on the command line after the name of the command) is too long.

Probable cause: When you type a wildcard character as part of a filename or pathname, UNIX replaces it with the list of filenames and then calls the command. If you go wild with the asterisks, the result is a very long list. The list can be more than 5,000 characters long, so it’s unlikely that you typed too long a list of filenames, unless you’re an unusually fast typist.

Example: You are in the root directory ( / ) and type this line:


ls */*

If a large number of files is in the root directory and its subdirectories, */* turns into a really long list.

Solution: Check the wildcards you used in the command, and use fewer of them.

Newer versions of UNIX allow much longer argument lists than older ones did. If you’re using a modern system, such as Linux or FreeBSD, and get this message, something strange is probably going on.


Broken pipe


Meaning: You are running two programs connected by a pipe, and the program at the receiving end of the pipe exited before it received all its data (refer to Chapter 7).

Probable cause: You get this error occasionally when you use a pipe ( | ) to redirect the output of a program into the more program and then press the q key to cancel the more program before you see all the output. The program has no place to put its output because you canceled the more program, so you get this error. In this case, it’s harmless.

Example: You type this line:


man furgle | more

The man program (which displays frequently incomprehensible UNIX manual pages) shows you screen after screen of boring information. You press the q key to cancel the more program, but the man program gives you the error message.

Solution: Nothing to do — it’s not really an error!


Cannot access


See the section “No such file or directory,” later in this chapter.


Cross-device link


See the section “Different file system,” later in this chapter.


Device or resource busy


Meaning: A device, such as a terminal or printer, is in use by another program.

Probable cause: Sometimes you see this message when you try to use cu or tip to access a terminal that’s already in use by another program or user.

Example: You type this line:


cu somesystem

Solution: Wait until the other user finishes.


Different file system


Meaning: You’re using the ln command to create a link to a file in a different file system (a different hard drive or a different computer).

Probable cause: You can’t create a hard link from one file system to another. The file you want to link to is probably in a different file system from the directory in which you want to make the link (usually the working directory).

Solution: Use the df command to find out which disks your computer has and which directories are on which disk. If the two directories are indeed on different disks, use ln -s to make a soft link.


File exists


Meaning: A file by that name already exists.

Probable cause: When UNIX expected the name of the file you want to create, you typed the name of a file that already exists.

Solution: You rarely see this message, because most UNIX commands blow away an existing file when they want to create a new one by the same name (which is not always what you want).


File table overflow


Meaning: The system is way too busy and can’t juggle as many files simultaneously as all the users have asked it to.

Probable cause: The system isn’t configured correctly, or someone is doing way too much work.

Solution: Complain to the system administrator.


File too large


Meaning: You are trying to make a file that is too big.

Probable cause: The maximum file size is set by your system administrator. A maximum file size prevents a messed-up program from making a file that uses up the entire disk by mistake. You’re not likely to really want to make a file this big. It usually happens when you use >> to add a copy of a file to itself, so you end up copying the file over and over until it passes the preset size limit.
Example: You type the line shown here:


pr myfile >> myfile

Solution: Check the command and make sure that you’re saying what you mean. If you’re sure that you want to make a really big file, talk your system administrator into upping your file-size limit.


Illegal option


Meaning: You typed an option that doesn’t work with this command. (Options tell the command how you want it to work. They begin with a hyphen.) Probable cause: You typed a hyphen in front of a filename, or you typed the wrong option.

Example: You type this line:


ls -j

Because the ls command has no -j option, you get an error message. Frequently, after the illegal option message, UNIX also prints a line about usage , which is its cryptic way of reminding you about which options do work with the command. (See the "Usage" section, later in this chapter.) Solution: Check your typing. Look up the command in this book to make sure that you know which option you want. Alternatively, use the man command to display an exhaustive and exhausting list of every option the command may possibly understand.


Insufficient arguments


Meaning: You left out some information.

Probable cause: The command you are using needs more arguments than the ones you typed. UNIX may also print a usage message in its attempt to tell you which arguments you should have typed. (See the "Usage" section, later in this chapter.) Example: The cp command needs two arguments: The first one tells it what to copy from, and the second one tells it what to copy to. You can’t leave out either one.

Solution: Check your typing. If the command is one you don’t use often, check to make sure that you used the correct arguments and options.


I/O error


Meaning: I/O is computerese for input and output. Some physical problem has occurred during the reading or writing of information on a disk, tape, screen, or wherever your information lives.

Probable cause: Broken disk drive.

Solution: Tell your system administrator. You may have big trouble ahead.


Is a directory


Meaning: You typed the name of a directory when UNIX wanted a filename.

Probable cause: The command you typed is trying to do something to a directory rather than to a file. You can look at a directory by using a text editor, but it looks like binary junk with filenames mixed in. You can’t change a directory by editing it.

Note that emacs has a special mode (called dired mode) for "editing" directories. But emacs has its own special way to create, rename, and delete files, too.

Solution: Make sure that you type a filename and not the name of a directory.


Login incorrect


Meaning: You are trying to log in and didn’t enter a correct username or corresponding password.

Probable cause: Two possibilities exist: One is that you typed your password incorrectly, and the other is that you typed your username incorrectly.

Solution: Type slowly and deliberately, especially when you type your password and can’t see what you are doing. If you have trouble remembering your password, use the passwd command to change it to something more memorable, as described in Chapter 2.


No process can be found


See the section “No such process,” later in this chapter.


No such file or directory


Meaning: UNIX can’t find a file or directory with the name you typed.

Probable cause: You spelled a filename or pathname wrong. This problem happens to most of us ten times a day. If you typed a pathname, you may have misspelled any of the directory names it contains. You may also have capitalized something incorrectly.

Example: You typed this line:


cp june.bugdet save

The file isn’t named june.bugdet , however — it’s june.budget .

Solution: Check your spelling and capitalization. Use the ls command to see how the file and directory names are spelled and whether they have any uppercase letters. For the pathname, check to see whether it begins with a slash (which means that it is an absolute pathname that describes the path from the root directory) or not (which means that it is a relative pathname that describes the path from the working directory). See Chapter 6 for more information about pathnames.


No such process


Meaning: UNIX can’t find the process you are referring to.

Probable cause: You have given a command that talks about processes, probably a kill command to stop a runaway process. (Chapter 23 describes what a process is and why you may want to kill the poor thing.) Solution: The process may already have gone away, in which case no problem exists. You may have mistyped the PID that specifies which process to do in. Check your typing and use the ps command to check the PID.


No more processes


Meaning: Your system can’t create any more new processes.

Probable cause: This message appears when you tell UNIX to create a new process, and UNIX can’t do it. Refer to Chapter 23 for information about processes.
Possible reasons for this message are that the system doesn’t have any more space for this kind of thing. Occasionally you get this message on very busy systems when you try to run something or if you start dozens of background processes (refer to Chapter 13).

Solution: Wait a minute and try the command again. If you have lots of background processes, get rid of some of them. If you see this message often, complain to your system administrator.


No space left on device


Meaning: The disk is full.

Probable cause: Either your files take up too much space or someone else’s do.

Solution: Delete something to make space. If you don’t think that you can or you don’t have any large files, talk to your system administrator. She probably already has gotten the same message and is checking to see who is taking up all the space.


Not a directory


Meaning: UNIX needed the name of a directory, but you typed a filename or the name of something else.

Probable cause: Either you spelled a directory name incorrectly or you forgot to create a new directory.

Example: You type this line:


cd /gillian

but no directory is named /gillian .

Solution: If you are referring to a new directory you planned to create, make it first by using the mkdir command. If you are referring to an existing directory, get the spelling right. Use the ls command to see how it’s spelled.


Permission denied


Meaning: You don’t have permission to do whatever the last command you issued tried to do.
Probable cause: You are trying to change, move, or delete a file you don’t own.

Example: You type this line:


rm /usr/bill/resignation.letter

But you are not Bill. Because you don’t have permission to delete this file, UNIX doesn’t let you.

Solution: Use the ls -l command to find out who owns the file and what its permissions are (refer to Chapter 5 for information about permissions). If you think that you ought to be able to mess with the file, make your own copy of it or talk to the owner of the file or your system administrator.


RE error


Meaning: You are using the grep program, and it doesn’t understand what you are searching for. (RE stands for regular expression, the name for the patterns that grep uses.) Probable cause: You probably have to use backslashes in front of a character that is a wildcard in grep .

Example: You type this line:


grep ‘[x’ myfile

Solution: Put a backslash in front of any character that has a special wildcard meaning in grep (grep wildcards include periods, asterisks, square brackets, dollar signs, and carets). If you are searching for text that contains special characters, put single quotation marks around the text to match.


Read-only file system


Meaning: You are trying to change a file that UNIX is not allowed to change.

Probable cause: Some disks, particularly NFS remote disks and CD-ROMs, are marked read-only so that you can’t create, delete, or change files on them. It doesn’t matter what the permissions are for the individual files: The entire file system can’t be changed.

Solution: Talk to your system administrator. Alternatively, make a copy of the file you want to change and change the copy.


Too many links


Meaning: You are trying to make so many links to a file that you have exceeded the maximum number of links to a file.

Probable cause: The maximum number of links to a file is 1,000. You must be a heck of a typist to get this message, or more likely you were running a script that linked a little more enthusiastically than you had intended. Because the parent directory is linked to each of its subdirectories, you also get this message if you try to make more than 1,000 subdirectories in one directory.

Solution: Stop making links.


Usage


Meaning: UNIX doesn’t like the number or types of arguments you typed after the command. It is telling you (in its own cryptic way) the correct way to use the command.

Probable cause: UNIX usually displays this message with another, more specific message. Check out the other message to see what the real problem was. The usage message is the UNIX reminder about how to use the command. After usage , you see the command, followed by the options and arguments you can use with the command. Unfortunately, you get no clue about what the options do.

Example: You type this line:


kill abc

UNIX responds with this message:

usage: kill [signo ] pid
This line means that the correct way to use the kill command is to type kill, a space, (optionally) the type of signal you want to send to the process, another space, and then the process ID. Don’t type the [ ] — we stuck them in to let you know which part of the command is optional — not that it’s entirely clear from the message!

Solution: Check your typing, as always. Make sure that spaces are between things on the line (between filenames or between a filename and an option, for example). If you don’t use this command often, check to make sure that you have the correct arguments (filenames and so on) and options (things that begin with a dash, such as the -l in ls -l ). Look up the command in this book or consult the UNIX manual page about it (see Chapter 26 for instructions on how to display manual pages).


444 mode? (or some other three-digit number) or override r-- r-- r-- johnl/staff for foo?


Meaning: You don’t have permission to change this file, but you have told UNIX to delete it.

Probable cause: You are using rm , mv , or ln to remove or replace a read-only protected file or a file that belongs to someone else. (See Chapter 5 for information about permissions.) Rather than refuse outright to do what you asked, UNIX asks whether you really want to do execute the command.

Example: You used the chmod command to make an important file read-only. Then you decide to delete it by typing this line:


rm important.file

UNIX asks whether you really want to delete it, even though the file is read-only.

Solution: The question mark at the end of this message indicates that UNIX is asking you a question. By divine intuition, you are supposed to guess that UNIX is asking whether you want to complete the command anyway. (On most modern UNIX systems, someone took pity on the poor users and changed the message to the slightly more comprehensible “override” version.) Press the y key if you want to go ahead and do the command. Press anything else if you want to cancel it (for this file, anyway).

If you own the file, you can change its permissions by typing this line:


chmod 644 filename

Rather than type filename , type the real filename. This command has the result of allowing anyone to read or write to the file.

/ 213