LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2009, 05:49 PM   #1
jcofell
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Rep: Reputation: 0
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.
 
Old 10-25-2009, 05:58 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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.
 
Old 10-25-2009, 06:02 PM   #3
jcofell
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 10-25-2009, 06:06 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
did you try
cp hplip/data/images/deskjet????????C hplip_stuff/color_deskjets/.
and
cp hplip/data/images/deskjet*C hplip_stuff/color_deskjets/.
 
Old 10-25-2009, 06:13 PM   #5
jcofell
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
file globbing

I have tried that and it keeps saying no such file or directory
 
Old 10-25-2009, 06:48 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by jcofell View Post
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.
 
Old 10-25-2009, 07:35 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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/
 
Old 10-26-2009, 04:08 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
nah, `backticks` are the suxx0rz (that means obsolete I believe), use $(this format) instead.
 
Old 10-26-2009, 10:26 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by acid_kewpie View Post
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.
 
Old 10-26-2009, 07:55 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
I'm old school as well; this newfangled $() notation is hard to get used to
 
Old 10-26-2009, 09:22 PM   #11
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
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
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat Academy Managing Files with File Globbing Online Exercises Jwood1988 Linux - Newbie 3 09-09-2009 08:41 PM
LXer: Bash Extended Globbing LXer Syndicated Linux News 0 10-09-2008 12:10 PM
Globbing using Korn Shell metallica1973 Programming 1 12-05-2007 05:56 PM
Globbing Problem in BASH Hink Programming 2 07-28-2005 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration