LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need Help With File Globbing (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-with-file-globbing-764394/)

jcofell 10-25-2009 04:49 PM

Need Help With File Globbing
 
I have been trying to finish this lab allday and cannot figure out the correct command. The problem is:

Copy every file from the hplip/data/images directory whose name starts with deskjet and whose model number ends in a C, into your newly created hplip_stuff/color_deskjets directory. Note, there are a different mix of lowercase and uppercase letters. Be sure to include them all.

acid_kewpie 10-25-2009 04:58 PM

Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

jcofell 10-25-2009 05:02 PM

File Globbing
 
I am a beginner and the only thing we were given in class was a few handouts which do not really help me at all. I tried all kinds of stuff. I tried cp hplip/data/images/deskjet* _*C hplip_stuff/color_deskjets/.

I know that is extremely wrong. I have no clue how to do it correctly.. Any hel will be appreciated.

smeezekitty 10-25-2009 05:06 PM

did you try
cp hplip/data/images/deskjet????????C hplip_stuff/color_deskjets/.
and
cp hplip/data/images/deskjet*C hplip_stuff/color_deskjets/.

jcofell 10-25-2009 05:13 PM

file globbing
 
I have tried that and it keeps saying no such file or directory

TB0ne 10-25-2009 05:48 PM

Quote:

Originally Posted by jcofell (Post 3732214)
I am a beginner and the only thing we were given in class was a few handouts which do not really help me at all. I tried all kinds of stuff. I tried cp hplip/data/images/deskjet* _*C hplip_stuff/color_deskjets/.

I know that is extremely wrong. I have no clue how to do it correctly.. Any hel will be appreciated.

Read the man page on the find command. Assume you're in the 'target' directory:

cp `find <insert find command options and names here>` ./

Note those are backticks, not single-quotes; that's another good thing for you to look up.

Also, we're always glad to help someone out, but posting blatant homework assignments is a good way to get NOTHING, especially posting it multiple times, without saying what you've done. And if the handouts/textbooks you were given don't cover the material, take that up with your instructor.

chrism01 10-25-2009 06:35 PM

Recommend you bookmark/read
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://linux.die.net/man/

acid_kewpie 10-26-2009 03:08 AM

nah, `backticks` are the suxx0rz (that means obsolete I believe), use $(this format) instead.

TB0ne 10-26-2009 09:26 AM

Quote:

Originally Posted by acid_kewpie (Post 3732607)
nah, `backticks` are the suxx0rz (that means obsolete I believe), use $(this format) instead.

Well, I'm 'old-skool' :) Besides, I figured most of that would be better left as an exercise for the OP, who was supposed to learn such things as it is. :)

chrism01 10-26-2009 06:55 PM

I'm old school as well; this newfangled $() notation is hard to get used to ;)

damgar 10-26-2009 08:22 PM

YAY! I think I did it! LOL, I know it wasn't my problem and it's no shot at the OP, just a linux newbie having fun with someone else's assignment...........

Thanks to all


All times are GMT -5. The time now is 09:02 PM.