![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The cut command. Really simple question! | rorey_breaker | Shell Programming and Scripting | 1 | 08-26-2007 09:08 AM |
| head command | sumesh.abraham | Shell Programming and Scripting | 6 | 02-23-2007 07:21 AM |
| simple 'head' question | terms5 | UNIX for Dummies Questions & Answers | 3 | 02-16-2006 09:31 PM |
| SImple command question | Diabeticus | UNIX for Dummies Questions & Answers | 4 | 02-08-2002 06:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Simple Command (head) Question
Okay, this probably sounds dumb for anyone who knows the answer, but I'm completely lost. I have to use the head command to search a directory AND all of its subdirectories to display the first line of all .txt files. I know how to do this: head -1 ~/UnixCourse/*.txt, but that does not search the subdirectories. I've tried to figure it out on my own and use help resources, but had no luck. I would really appreciate if someone could save me a little time and effort by helping me out here.
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
look into 'man find'
|
|
#3
|
|||
|
|||
|
I've looked into find and understand how to make that work with subdirectories, but I have not seen any way to use it with the "head" command. Am I missing something or was I just not clear that I need to use the head command to get the first lines of each file?
|
|
#4
|
||||
|
||||
|
Look at the -exec part of the man page....
Cheers ZB |
|
#5
|
|||
|
|||
|
Ahh got it now, thanks
|
|||
| Google The UNIX and Linux Forums |