LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-30-2006, 11:06 AM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
To copy files from a CD to a folder on your system


Now I have Fedora Core5. My Mandriva has gone to hell. I inserted a CD.It created a icon on the desktop.

I want to copy the whole content of the CD using the 'cp' command.

What is the command to copy the all the files on the CD onto the 'Documents' directory?


[Nissanka@c83-250-99-43 ~]$ pwd
/home/Nissanka
[Nissanka@c83-250-99-43 ~]$



[Nissanka@c83-250-99-43 Documents]$ pwd
/home/Nissanka/Documents
[Nissanka@c83-250-99-43 Documents]$
---------------------------------------------------------------------------------------------------------------------

Where does the CD resides? I thought when you insert a CD in Fedora Core5, it would reside on the 'mnt' folder.

No it is not there.

[Nissanka@c83-250-99-43 ~]$ cd /mnt
[Nissanka@c83-250-99-43 mnt]$ ls
[Nissanka@c83-250-99-43 mnt]$
 
Old 10-30-2006, 11:23 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In RHEL4, removable media get mounted in /media (my guess is that Fedora is the same). Once the icon is on the desktop, you know it is mounted---do "more /etc/mtab" to see where.

Assuming it is mounted in /media, then do this:
"cd /media/<mountpoint>", where <mountpoint> will be something like cdrecorder
"ls" (to show everything on the cd)--if necessary, cd into some folders

To copy everything on the cd:
"cd /media/<mountpoint>"
"cp -R * /home/<usernamer>/<foldername>" ---eg /home/frank/documents

One hint: When you go to /mnt or /media, you may see LOTS of folders (mountpoints). To what is mounted and has content, do:
"ls *"
OR
"ls -R *"

Quotes (") indicate commands to be typed--don't type the quotes!
 
Old 10-30-2006, 11:38 AM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
pixellany

You are clever. It is mounted on 'media'

[Nissanka@c83-250-99-43 ~]$ cd /media
[Nissanka@c83-250-99-43 media]$ ls
K3b data project
[Nissanka@c83-250-99-43 media]$

The name of the cd is 'K3b data project'.

What would be the proper command to copy entire CD onto '/home/Nissanka/Documents' folder?

-------------------------------------------------------------------------------------------------------

[Nissanka@c83-250-99-43 media]$ cp -R* /home/nissanka/Documents
cp: invalid option -- *
Try `cp --help' for more information.
[Nissanka@c83-250-99-43 media]$ cp -R /home/nissanka/Documents
cp: missing destination file operand after `/home/nissanka/Documents'
Try `cp --help' for more information.
[Nissanka@c83-250-99-43 media]$

[The * sign is not acceptable. What would be the problem?]

----------------------------------------------------------------------------------------------
[Nissanka@c83-250-99-43 media]$ cp /media/K3b data project /home/nissanka/Documents
cp: target `/home/nissanka/Documents' is not a directory
[Nissanka@c83-250-99-43 media]$

Last edited by Gins; 10-30-2006 at 11:45 AM.
 
Old 10-30-2006, 11:48 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You need a space between the R and the *.
 
Old 10-30-2006, 11:52 AM   #5
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Nylex, it didn't work.


Nissanka@c83-250-99-43 media]$ cp -R * /home/nissanka/Documents
cp: cannot create directory `/home/nissanka/Documents': No such file or directory
[Nissanka@c83-250-99-43 media]$
------------------------------------------------------

[Nissanka@c83-250-99-43 ~]$ ls
Desktop
Documents
[Nissanka@c83-250-99-43 ~]$
----------------------------------------------------------------------------
[Nissanka@c83-250-99-43 ~]$ pwd
/home/Nissanka
[Nissanka@c83-250-99-43 ~]$

Last edited by Gins; 10-30-2006 at 11:55 AM.
 
Old 10-30-2006, 11:59 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Maybe the folder is "documents"?? (Remember that linux is case-sensitive)
 
Old 10-30-2006, 12:01 PM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
It says the destination directory doesn't exist.. you need to manually create that directory first if you are going to issue a command to copy files to it as a destination

mkdir /home/nissanka/Documents
cp -R * /home/nissanka/Documents/
 
Old 10-30-2006, 12:01 PM   #8
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
No pixellany

I have copied and posted here. If you look carefully, it is 'Documents'.
 
Old 10-30-2006, 12:04 PM   #9
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
farslayer

Nissanka@c83-250-99-43 ~]$ pwd
/home/Nissanka
[Nissanka@c83-250-99-43 ~]$ mkdir Documents
mkdir: cannot create directory `Documents': File exists
[Nissanka@c83-250-99-43 ~]$

It is already there.
 
Old 10-30-2006, 12:06 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Note that cp will create a new filename when you are copying ONE file. But it will not create a new directory name.

cp <filename> /path/morepath/<newfilename> WORKS

cp <filename> /path/morepath/<newdirname>/<newfilename> Does NOT work
 
Old 10-30-2006, 12:09 PM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by Gins
farslayer

Nissanka@c83-250-99-43 ~]$ pwd
/home/Nissanka
[Nissanka@c83-250-99-43 ~]$ mkdir Documents
mkdir: cannot create directory `Documents': File exists
[Nissanka@c83-250-99-43 ~]$

It is already there.
Are you sure that "Documents" is a directory? (do ls -l)

If there really is a directory /home/Nissanka/Documents, then try copying ONE file to that directory:

eg: cp /path/filename /home/Nissanka/Documents
 
Old 10-30-2006, 12:11 PM   #12
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
pixellany

Could you write me the correct command? I must copy a bunch of files.
In the 'media' folder you find 'K3b data project'

Now I am in the media folder.

This 'K3b data project' cd has some of my old work. I did some work on scripting.
---------------------------------------------------------------------------------------------------------------------
Nissanka@c83-250-99-43 media]$ pwd
/media
[Nissanka@c83-250-99-43 media]$
 
Old 10-30-2006, 12:12 PM   #13
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
[Nissanka@c83-250-99-43 ~]$ ls -l
total 48
drwxr-xr-x 2 Nissanka Nissanka 4096 Oct 30 18:29 Desktop
drwxrwxr-x 2 Nissanka Nissanka 4096 Oct 30 17:54 Documents
-rw-rw-r-- 1 Nissanka Nissanka 623 Oct 30 16:57 How_to_find_the_size_of_all_the_partitions_on_my_system
-rw-rw-r-- 1 Nissanka Nissanka 804 Oct 30 16:53 How_to_find_the_size_of_the_Linux_partition
-rw-rw-r-- 1 Nissanka Nissanka 367 Oct 30 16:48 How_to_find_the_size_of_the_swap_file.
-rw-rw-r-- 1 Nissanka Nissanka 308 Oct 30 17:44 How_to_mount_a_partition
[Nissanka@c83-250-99-43 ~]$
 
Old 10-30-2006, 12:26 PM   #14
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
The funny thing is that I tried the drag and drop method. That is crude way of transferring files. Especially, when you have to transfer over 50 files.

It worked beautifully.

This is a heck of a problem. The 'cp' command should work. Why doesn't it work?
 
Old 10-30-2006, 12:26 PM   #15
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by Gins
pixellany

Could you write me the correct command? I must copy a bunch of files.
In the 'media' folder you find 'K3b data project'

Now I am in the media folder.

This 'K3b data project' cd has some of my old work. I did some work on scripting.
---------------------------------------------------------------------------------------------------------------------
Nissanka@c83-250-99-43 media]$ pwd
/media
[Nissanka@c83-250-99-43 media]$
Is 'K3b data project' the name of a folder(directory)?
In /media, you should have names like "cdrecorder". You cd into that directory and then you are seeing the files on the CD. Get yoursefl to the point where you are looking at the actual files and directories that you want to copy, then do:

mkdir /home/Nissanka/Documents/CDcontents
cp -R * /home/Nissanka/Documents/CDcontents

I added a new directory step here so that all the CD stuff doesn't get mixed in with everything else in .../Documents
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't copy files from an SCO Unix System V computer to a Linux computer gnppapas Linux - General 2 11-27-2004 01:39 PM
How to copy in a script files to a samba folder? Julianus Linux - Networking 1 10-09-2004 07:29 PM
Copy Files Between Drives Causes Kernel Panic/Freeze of the System php Slackware 7 08-14-2003 07:30 PM
boot error after using Copy Commander to copy debian system onto larger new drive Interceptor Linux - Hardware 7 05-04-2003 12:40 PM
How to copy files from A computer of NT System to The other one of Unix system? whepin Linux - Newbie 5 04-06-2003 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration