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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-30-2006, 11:06 AM
|
#1
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Rep:
|
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]$
|
|
|
10-30-2006, 11:23 AM
|
#2
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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!
|
|
|
10-30-2006, 11:38 AM
|
#3
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
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.
|
|
|
10-30-2006, 11:48 AM
|
#4
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep:
|
You need a space between the R and the *.
|
|
|
10-30-2006, 11:52 AM
|
#5
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
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.
|
|
|
10-30-2006, 11:59 AM
|
#6
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
Maybe the folder is "documents"?? (Remember that linux is case-sensitive)
|
|
|
10-30-2006, 12:01 PM
|
#7
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep:
|
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/
|
|
|
10-30-2006, 12:01 PM
|
#8
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
No pixellany
I have copied and posted here. If you look carefully, it is 'Documents'.
|
|
|
10-30-2006, 12:04 PM
|
#9
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
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.
|
|
|
10-30-2006, 12:06 PM
|
#10
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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
|
|
|
10-30-2006, 12:09 PM
|
#11
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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
|
|
|
10-30-2006, 12:11 PM
|
#12
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
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]$
|
|
|
10-30-2006, 12:12 PM
|
#13
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
[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 ~]$
|
|
|
10-30-2006, 12:26 PM
|
#14
|
Senior Member
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Original Poster
Rep:
|
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?
|
|
|
10-30-2006, 12:26 PM
|
#15
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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
|
|
|
All times are GMT -5. The time now is 08:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|