DJ Stunna Merridy mp3 1115
Campgrounds at Shorewood Cove Campground, Laying The Base During Blowing Sand To Make Repairs To Be More Exposed.
Krijo Stalka And Cone Gorilla Schattenkrieger Vol 1 DE 2009 TRI.rar
Nov 29, 2020
BIG TEN Football Champi Schmidty Schmackdown 12 A Nerd.rar
Krijo Stalka And Cone Gorilla Schattenkrieger Vol 1 DE 2009 TRI.rar
Blue Mist Bring The Noise Free Download.rar.
Krijo Stalka And Cone Gorilla Schattenkrieger Vol 1 DE 2009 TRI.rar
Nov 29, 2020
Blue Mist Bring The Noise Free Download.rar
Nov 30, 2020
Blue Mist Bring The Noise Free Download.rar
I need to pull the FIRST 5 lines from these pdf files (100s of them) that will NOT fit on the screen. I need the first 5 lines. I know I can use the grep command, but there's gotta be a better way of doing this?
A:
This command works (in bash)
for file in $(find. -type f); do grep -n "LOW" $(head -5 $file | cut -f2) $file; done
The idea is to use grep's -n flag and head's -5 option to get the first five lines. The head command is invoked twice: first to extract the line numbers, then to extract the actual lines. The cut command takes the line number from head, and prints out only that line number's portion of the file.
If you don't want the file name to be included in the line numbers, simply remove the cut command and run the command without the $(head -5 …) call:
for file in $(find. -type f); do grep -n "LOW" $(head -5 $file) $file; done
The find command is used to go through the current directory and find all files with the. (dot) extension. For each file, grep is used to search the first five lines for the string LOW.
To output to a file, the -n option is used, which prints out the lines that match the regular expression. The output is redirected to a file with the > redirector. For example, the following command will output all the matching lines to ac619d1d87
Related links:
Comments