File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Access CD-ROM drive on Linux's bash Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Access CD-ROM drive on Linux Watch "Access CD-ROM drive on Linux New topic
Author

Access CD-ROM drive on Linux's bash

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I installed Linux on a small PC. I did not install windows KDE etc. How do I copy my software (tomcat and JDK) from CD-ROM drive to Linux PC?
I am new to Linux and I don’t know how to see CDROM using bash.
Thanks.
Bruce
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
you need to "mount" the cdrom drive before you can access it's files... issue the command:
mount /mnt/cdrom (to mount the cdrom. this is assuming your cdrom is located in the /mnt path)
dir /mnt/cdrom (to list directories/files on the cdrom and make sure you know the full path to the files you need to copy)
now make sure you are in the directory where you want to copy the files TO... or, know where you want to copy them to...
cp /mnt/cdrom/< path and filename > .
notice the . after filename > that tells the file to copy to the current directory. otherwise, you would issue this command:
cp /mnt/cdrom/< path and filename > /< path to copy to >


what?
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thank you Greg!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

I may be wrong, but I think the cp command won't copy subdirectories unless you specify the --recursive option. Also, unlike MS-DOS COPY, "cp" ALWAYS requires both source and destination to be specified, it won't assume the current directory as the destination by default. Use "." to indicate the current directory - it's quicker and less error-prone than typing in the name.
As a precaution, when copying to some other directory, I like to tack on a trailing slash to let cp know the target is in fact a directory. That way if I misspell the target or there's a file there instead, the copy won't simply write each source file in turn over the same destination file. Works in DOS, too.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks!
I will play a little before I copy the real thing.
Bruce
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
Tim,
you are right about the sub-directories... i replied in a hurry and did not include all the information. thanks for checking on me!
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I re-boot my Linux and issued this:
$ mount /mnt/cdrom
it tells me that “/mnt/cdrom/ already mounted".
Then I issued
$ dir /mnt/cdrom
it tells me that “input/output error”
What’s going on?
I have Linux for Dummy book and a few Mandrake manuals. But I can’t figure out how to see my CD-ROM and how copy files from CD to PC. Maybe I need to install KDE and use gui to do this?
Thanks.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Sorry. I found out that /mnt/cdrom is for the CD-RW drive. and there is a /mnt/cdrom2 for the CD-ROM drive. When I started the PC, both are mounted automatically.
Now I am trying to load JDK and Tomcat to my little Linux box.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access CD-ROM drive on Linux's bash