Answer the question
In order to leave comments, you need to log in
How to print lines 15 to 35 in terminal them under terminal in linux?
I just started to study UNix from under linux
Interested in how to do: -
output lines from 15 to 35 and write to the file 15-35_app_log.txt
- add line 36 to the file 15-35_app_log.txt, rename the file acc.
Answer the question
In order to leave comments, you need to log in
It can be simpler, with one command, and the deltas in the head for tail do not need to be countedcat sourcefile.txt | sed -n 15,35p
If anything, here's my code:
#!/bin/bash
for i in $(find /etc/ -type f);
do cat $i | head-n5 | tail -n1 >> ~/000
done
sort ~/000
It takes all the files from the etc folder, takes the fifth line from them and outputs them to a file that it creates in the home directory and then sorts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question