The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
The cut command. Really simple question! rorey_breaker Shell Programming and Scripting 1 08-26-2007 01:08 PM
head command sumesh.abraham Shell Programming and Scripting 6 02-23-2007 10:21 AM
simple 'head' question terms5 UNIX for Dummies Questions & Answers 3 02-17-2006 12:31 AM
SImple command question Diabeticus UNIX for Dummies Questions & Answers 4 02-08-2002 09:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-23-2006
jbud jbud is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
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.
  #2 (permalink)  
Old 04-23-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,128
look into 'man find'
  #3 (permalink)  
Old 04-23-2006
jbud jbud is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
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 (permalink)  
Old 04-23-2006
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Look at the -exec part of the man page....

Cheers
ZB
  #5 (permalink)  
Old 04-23-2006
jbud jbud is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
Ahh got it now, thanks I had tried it once before but did not use the {}'s correctly so could not figure it out. Thanks again for the help!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0