10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
AXCVB,... (5 Replies)
Discussion started by: nani2019
2. UNIX for Beginners Questions & Answers
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
3. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
4. Shell Programming and Scripting
i have a file which contains PID and wanted to execute kill command. but the thing is, when killing PID's needs to kill PID from bottom to top.
21414 sh -c extract.ksh ASA
21416 /bin/ksh extract.ksh ASA
21428 /usr/bin/perl -w /var/tmp/tempperl.21416 ASA... (4 Replies)
Discussion started by: reignangel2003
5. Shell Programming and Scripting
In a directory I have more than 200 files with the extension .log
Using head command I want to print first 20 lines of each log file.
For each .log file, it should print like below
Printing first 20 lines of : GRP_error_April29.log
Apr 29 04:02:05 raptor03b syslogd 1.4.1:... (4 Replies)
Discussion started by: John K
6. Shell Programming and Scripting
I have a folder with multiple (< 33) .log files.
And I have to copy the lines between two patterns from all the .log files to a new file.
(script file with a loop?)
Thanks in advance.
>>> Total: 2 Alarms
.. (17 Replies)
Discussion started by: AK47
7. Shell Programming and Scripting
How to remove x lines form top and y lines form bottom.
This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)'
so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
8. Shell Programming and Scripting
I need a one liner to parse through a log and if the string is found print the line above, the line with the string and the line below.
The ball is green and blue
Billy through the ball higer.
Jane got hurt with the ball.
So if I search for Billy I would need the 3... (1 Reply)
Discussion started by: bombcan
9. Shell Programming and Scripting
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
+SRR057408.1 FW8Y5CK02R652T length=34
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
10. Shell Programming and Scripting
grep for a particular pattern and remove 5 lines above the pattern and 6 lines below the pattern
root@server1 # cat filename
Shell Programming and Scripting test1
Shell Programminsada asda
dasd asd Shell Programming and Scripting Post New Thread
Shell Programming and S sadsa ... (17 Replies)
Discussion started by: fed.linuxgossip