On Sunday 04 February 2007 20:12, Barry Chater wrote:
barry2006@barry2006-laptop:~$ sudo rm pavcl_linux.tgz Password: rm: cannot remove `pavcl_linux.tgz': No such file or directory barry2006@barry2006-laptop:~$
and this is the file i am trying to remove
barry/pavcl_linux.tgz
Have you managed to do this yet? I notice you've had some secret correspondence with Jenny - perhaps she fixed your problem. Also, I guess Keith was probably right.
The problem is most likely that rm doesn't know which file you are referring to as your command is not specific enough - you haven't told it exactly where the file is.
Sorry if you know all this, but lets take a look at your command prompt:
barry2006@barry2006-laptop:~$
it is of the forms
{user name} @ {compter name} : {present working directory} $
in this case, the present working directory is "~" which is shorthand for the current user's home directory, in your case, probably "/home/barry2006".
(You can also check your present working directory with the pwd command.)
When you give a filename argument to a program, it either expects that file to be in the present working, a relative path from the present working directory or it expects it to be an absolute path, i.e. the complete path from the initial "/" through all the parent directories up to the file itself.
So, for example, say your home directory contains a directory called "Documents" which, in turn, contains a file called "letter.txt", and your prompt is like this:
barry2006@barry2006-laptop:~$
(i.e., your present working directory is your home directory), you can refer to the letter.txt file like this:
barry2006@barry2006-laptop:~$ head Documents/letter.txt
this is a relative path, from the present working directory (/home/barry2006) to the Documents directory (/home/barry2006/Documents)
You can also refer to it like this:
barry2006@barry2006-laptop:~$ head /home/barry2006/Documents/letter.txt
this is an absolute path.
Now, the problem you are having is that the file you want to refer to is in different directory to your present working directory, it is in the root directory (/). There are two options: either give rm an absolute path to the file:
barry2006@barry2006-laptop:~$ sudo rm /pavcl_linux.tgz
or change the present working directory to the root directory and then give rm the plain filename:
barry2006@barry2006-laptop:~$ cd / barry2006@barry2006-laptop:~$ sudo rm pavcl_linux.tgz
Hope thats clear?
Cheers, Richard