1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Help with a Linux problem question

  1. Oct 2, 2012 #1
    This is my first time on this site so I'm not sure if I am even posting in the right section...
    Well I had a exam last week on commands and utilities and I wasn't sure how to aswer one of the question. The question is how do you print the first 15 lines of all files ending by “.txt” in all your folders and subfolders?
    i know i have to use the head command but where do i go from there?
  2. jcsd
  3. Oct 2, 2012 #2

    jim mcnamara

    User Avatar

    Staff: Mentor

    Code (Text):

    find $HOME -name '*.txt' -exec head -15 {} \;
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook