• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

linux command

DIRTsquirt

Senior member
can anyone tell the command line command for copying the contents of a cdrom to a directory on the harddrive?
I am able to do it one file at a time but man is that a pain..
thanx in advance
 
Thanks folks..
can I get some clarification on the man cp command?

I found that if you are the the directory to be copied this works cp*.* /home/directory here

Thanks guys!
 
First you don't need *.*, this isn't DOS. In Linux the wildcards work on the whole filename reguardless of .s as they should.

cp has a lot of options, but all you should need is -R for recursive, if you want to copy all subdirectories too. cp -R source target
 


<< can anyone tell the command line command for copying the contents of a cdrom to a directory on the harddrive?
I am able to do it one file at a time but man is that a pain..
thanx in advance
>>



If file permissions and owner/group info is important on those files the best way to do it is like this:

find . -print | cpio -pdvm /tmp/cdrom


Basically cd into the directory you want to start copying from... then issue that command replacing /tmp/cdrom with your destination directory...

cd </origin dir>
find . -print | cpio -pdvm </destinationdir>


This will maintain all the ownership and permissions and file dates etc.. from the original files correctly... I think it also will copy any empty subdirectories which I believe cp wont do..

 


<< Thanks folks..
can I get some clarification on the man cp command?

I found that if you are the the directory to be copied this works cp*.* /home/directory here

Thanks guys!
>>


"man blah" gives you the "man" (manual) page for program or file blah. "man cp" would give you the syntax, usage, etc of the "cp" command. basically, n0cmonkey was:

1. telling you to RTM
2. explaining how to RTM in linux 😉
 
And people wonder why linux users are considered to be arrogant self absorbed arses..
Flame on!!
For those off you that are gracious and not full of yourselves I ask one more question Where do you find the manual this guy is talkin about.. can it be downloaded? or accessed via the net..
Thanks for your patients and the answers to my questions.. I see I will prolly have to find a different forum for linux questions. These doods are to crotchety for me.. LOL
Happy New Year Everybody!!
 
And people wonder why linux users are considered to be arrogant self absorbed arses..
Flame on!!


I never understood this. He told you how to read the manual for the command you wanted, what's arrogant about that?

For those off you that are gracious and not full of yourselves I ask one more question Where do you find the manual this guy is talkin about.. can it be downloaded? or accessed via the net..

He said the command you use to read them, they're installed by default in every distribution I've ever seen.

Thanks for your patients and the answers to my questions.. I see I will prolly have to find a different forum for linux questions. These doods are to crotchety for me.. LOL

If you're that easily offended I doubt you'll find a forum that will make you happy.

edit: didn't realize you were the original poster at first.
 


<< And people wonder why linux users are considered to be arrogant self absorbed arses..
Flame on!!


I never understood this. He told you how to read the manual for the command you wanted, what's arrogant about that?
>>


agreed.



<< For those off you that are gracious and not full of yourselves I ask one more question Where do you find the manual this guy is talkin about.. can it be downloaded? or accessed via the net..

He said the command you use to read them, they're installed by default in every distribution I've ever seen.
>>


yeah. if you ever get a reply "man something" then just type it - if it doesn't work, you most likely dont have the program. when you install most apps, they include the man pages

Thanks for your patients and the answers to my questions.. I see I will prolly have to find a different forum for linux questions. These doods are to crotchety for me.. LOL

If you're that easily offended I doubt you'll find a forum that will make you happy.

edit: didn't realize you were the original poster at first.[/i] >>



hope you aren't serious about finding a different forum.... n0cmonkey is really helpful and very knowlegable, as are many people here. i dont think anyone intended offense
 
I should have not written my last post. But to address your bewilderment or possibly my lack of finese in things written.. Please attempt to discern my meaning from the following: Three posts appeared to be arrogant to me. at least at first and in the end really only 2 where.
and I guess there is some truth in the words of wisdom laid down by Jako (Michael Jackson) "One bad apple dont spoil the whole bunch girl"
I not being able to do a simple multiple file transfer. would indicate that I am newbie 🙂. On the face of it the two word reply told me nothing as I had no Idea what it meant or signified.. to me it was 2 words well almost 2 words.


<< man cp >>

The first clue I got that he was pointing me at the manual was (ctho and ellen)'s posts.You remember, the ones where they point there fingersand laughed or in acuality roll on the floor laughing their ass's off. At the newbie. I am willing concede that I may have been reading something into there condescension.
in regards to nocmonkey. in retrospect knowing what I know now he was trying to be informative in his own brief way. : )
I would like to thank HigherGround for the informative post
I would also like to Say Awesome post! to Da hitman. it was well thought out. complete with 8X10 color glossies, descriptive (even a newbie could figure it out)
I would like to thank Nothing man for pointing me in the direction of a potential manual... My distro is Engarde Secure Linux it came with a 257 page manual. theyassume you have a basic knowledge of linux and waste no space on basics... The man cp command yeilds this response.....bash: man: command not found....
they assume you have a basic working knowledge of linux and consequently waste no time on the basics. I will try to find the smallest distro of linux of a popular version and try to figure out how to extract the manual with out installing it as I have no other computer to install it on.
to address the *.* issue thanks for setting me straight.. I guess you are right this aint dos LOL
I do however find it interesting that cp *.* /directory actually worked and transfered the entire contents of my cd to the directory on my harddrive..
judging from yourcomments linux ignored the *.* (usually a bad switch will give you an error message) and read it as cp /directory
I will test this theory next time I have to transfer data.
Best Wishes for Prosperous new year!
 
does *.* match files with no extension? it does in DOS because everything really has an extension, but that isn't true in *nix
 


<< does *.* match files with no extension? it does in DOS because everything really has an extension, but that isn't true in *nix >>

If you want to say 'all files' with *NIX, you use *

If you want to select only files with a certain extension, you use *.txt or with another extension of course 🙂

Further you can do a lot more stuff when selecting files to be copied/removed etc., like selecting only files which contain a certain string of text etc.
 
That's one of the reasons I like Linux and NIX's in general. The use of meta-characters to find stuff is really extermely helpful and powerful. For example to find nv_glx and Nvidia_GLX all I would have to do is:

find / -name [Nn][vV]*_[gG][lL][xX] if I wanted to find all jpeg's and jpg's and remove them from my the current directory tree it would be: find . -name "*.jp*g" -ok rm {} \;

 
judging from yourcomments linux ignored the *.* (usually a bad switch will give you an error message) and read it as cp /directory

No, because cp requires atleast 2 arguments. Source and destination, if source is multiple files (the shell expands wild cards like * to whatever they really match) the second must be a directory. All of your files must have had periods in the name meaning *.* matched.
 
DIRTsquirt, my response was short, simple, and to the point. The man page will give you more information than you need/want to know, quicker and better written than 90% of the people on these boards. And heck, HigherGround's response might have worked anyways, so I was giving you another direction to go in to get more information than just the little bit that would answer your question. No insult meant, although it may have been a little RTFMish 😉
 
Back
Top