How do I copy a file from my CD to my hard drive

Asked by Bob Pearson

I want to copy a file from a CD to a folder/directory on my hard drive. It is just a single file in tar.gz format which I have downloaded and then burnt to the CD, it is not sitting in a subfolder/subdirectory on the CD. I have no GUI as this is a server (Gutsy 7.10 server edition) so I must do it from bash. Can someone let me have the full command line to do this please?
PS I can accept answers in German as well as English.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Bob Pearson
Solved:
Last query:
Last reply:
Revision history for this message
Allen Chemist (alchemist) said :
#1

Hallo Bob!

First, you need to ensure the cdrom is mounted. Type
ls /media/cdrom/

if it shows your file, you are good to go down to 2.
If not, type
sudo mount /dev/cdrom /media/cdrom

2. Now, to copy it from the cdrom to your home folder, type this:
cp /media/cdrom/filename.tgz ~/

Using bash, you can also use 'tab completion'. instead of typing out the entire filename, you can hit the tab key to fill it in. You must have typed enough of the name for bash to know which file you are talking about. For example, cp /m<TAB> doesn't give enough information, because you have media, mnt, etc. However, typing cp /me<TAB> will result in it filling in to cp /media/. To see possibilities, try cp /m<TAB><TAB> and it will show you "media" and "mnt", so type either e or n (for mEdia or mNt).

The ~ above stands for your home directory.

For more information on the command line, see
https://help.ubuntu.com/7.10/basic-commands/C/

Revision history for this message
Bob Pearson (admin-bpcsbromyard) said :
#2

Thanks Allen for your quick response. I had to go out, so had no chance to try it yesterday. I've just done it this morning and it's worked fine. Bash is quite a learning curve for an ex DOS convert, but I'm beginning to get the hang of it.