LinuxQuestions.org
Review your favorite Linux distribution.
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 09-13-2010, 05:47 PM   #1
BlaqkStarSunday
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
File Globbing


Use file globbing to copy all the files in the /labs/data directory that end with a .out to the lab05 directory.



Use file globbing to copy all the files in the /labs/data directory that start with a c, d, or n into the lab05 directory.

HELP ME PLEASE!
 
Old 09-13-2010, 06:07 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,817

Rep: Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610
Do your own homework.
 
Old 09-13-2010, 06:10 PM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
find /labs/data -type f -name '*.out" -exec cp {} lab05 \; Or the absolute path to lab05

find /labs/data -type f -name 'c*' -o -name 'd*' -o -name 'n*' -exec cp {} lab05 \;
 
Old 09-13-2010, 06:16 PM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
trist007: why on earth would he do all that?

BlaqkStarSunday: read the manual for your shell, searching for things like 'pattern' and/or 'glob'. Then apply what you learn.
 
Old 09-13-2010, 06:34 PM   #5
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
cp *.out a* c* d* lab05
 
Old 09-13-2010, 06:35 PM   #6
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
cp [acd]* *.out lab05
 
  


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
Help with cp using absolute paths and globbing. Dru-Jitsu Linux - Newbie 4 06-24-2010 01:03 PM
Help with cp using absolute paths and globbing. Dru-Jitsu Linux - Newbie 1 06-24-2010 11:23 AM
Need Help With File Globbing jcofell Linux - Newbie 10 10-26-2009 08:22 PM
how to enable globbing ravidangaych Linux - General 2 10-26-2009 10:11 AM
Red Hat Academy Managing Files with File Globbing Online Exercises Jwood1988 Linux - Newbie 3 09-09-2009 07:41 PM


All times are GMT -5. The time now is 08:43 PM.

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