Hi I have got a problem that i cannot seem to solve. i copied a folder to the root directory using the terminal in gnome. I then could not get the file to extract using the gzip_d pavcl_linux.tgz command only to get the file or directory not found. so i got fed up and decided to remove the file pavcl_linux.tgz using the rm pavcl_linux.tgz command only to get the same reply.tried all these with sudo in front, no success. also typed the i command to get to root access but still no success. then i thought i would use the file browser to delete the file but it tells me that i do not have permission to move or copy the file. this is really spoilling my enjoyment with linux as i cannot seem to be able to copy or remove files with the terminal even though i copy the text exactly from the documentation, and ubuntu book. what am i doing wrong. here is some of what i am doing 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
barry
From: Barry Chater Sent: 04 February 2007 20:13
Hi I have got a problem that i cannot seem to solve. i copied a folder to the root directory using the terminal in gnome. I then could not get the file to extract using the gzip_d pavcl_linux.tgz command only to get the file or directory not found. so i got fed up and decided to remove the file pavcl_linux.tgz using the rm pavcl_linux.tgz command only to get the same reply.tried all these with sudo in front, no success. also typed the i command to get to root access but still no success. then i thought i would use the file browser to delete the file but it tells me that i do not have permission to move or copy the file. this is really spoilling my enjoyment with linux as i cannot seem to be able to copy or remove files with the terminal even though i copy the text exactly from the documentation, and ubuntu book. what am i doing wrong. here is some of what i am doing barry2006@barry2006-laptop:~$ sudo rm pavcl_linux.tgz Password: rm: cannot remove `pavcl_linux.tgz': No such file or directory barry2006@barry2006-laptop:~$
try;
sudo rm /pavcl_linux.tgz
or, if you're really feeling brave
sudo rm -f /pavcl_linux.tgz
and this is the file i am trying to remove
barry/pavcl_linux.tgz
barry
Regards,
Keith ____________ 'I always use the word impossible with the greatest caution.' - - Wernher Von Braun
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
On Monday 05 February 2007 16:49, Richard Lewis wrote:
On Sunday 04 February 2007 20:12, Barry Chater wrote:
barry2006@barry2006-laptop:~$ sudo rm pavcl_linux.tgz
I hope you spotted the deliberate "mistake" here: after the cd command, the prompt will, of course, change to show the present working directory as root:
barry2006@barry2006-laptop:~$ cd / barry2006@barry2006-laptop:/$ sudo rm pavcl_linux.tgz
R.
Richard Lewis wrote:
On Monday 05 February 2007 16:49, Richard Lewis wrote:
On Sunday 04 February 2007 20:12, Barry Chater wrote:
barry2006@barry2006-laptop:~$ sudo rm pavcl_linux.tgz
_I hope you spotted the deliberate "mistake"_ here:
No, I should have gone to specsavers :-D
after the cd command, the prompt will, of course, change to show the present working directory as root:
barry2006@barry2006-laptop:~$ cd / barry2006@barry2006-laptop:/$ sudo rm pavcl_linux.tgz
R.
Richard Lewis wrote:
Have you managed to do this yet?
*** I was given a tip to use the nautilus file browser with root privileges by typing*
gk sudo nautilus in the terminal, the response was that it could not do it but then nautilus launched and i was able to delete file.
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:(no i don't know all this)
barry2006@barry2006-laptop:~$
Hope thats clear? (a lot clearer now thanks)
Cheers, Richard
The trouble was i was following instructions from website of how to install, and from text book of how to remove a file and neither was working, probably me not knowing what i was doing! This directory stuff takes me back to the days of Ms dos where you have to tell it exactly where to look of the computer sulks and takes its bat and ball home. I can see i have a lot to learn thanks for your help For now given up on installing an antivirus program till i know a bit more or until i get one that install through the ubuntu package installer. something you definitely could not do with windoze Thanks again Barry