10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I wish to print first, third and sixth till the last column from the output of ls command
ls -ltr /app/deploy.yml
-rw-rw-r-- 1 user1 dba 27342 Aug 28 10:17 /app/deploy.yml
Desired Output:
Below command gives me the desired output.
ls -ltr /app/deploy.yml | awk '{$2=$4=$5=""; print... (6 Replies)
Discussion started by: mohtashims
6 Replies
2. UNIX for Beginners Questions & Answers
For some reason I am having difficulty performing what should be a fairly easy task. I would like to print lines of a file that have a unique value in the first field. For example, I have a large data-set with the following excerpt:
PS003,001 MZMWR/ L-DWD// *
PS003,001... (4 Replies)
Discussion started by: jvoot
4 Replies
3. AIX
Please help me
print nth line after match
awk or sed one line command. (3 Replies)
Discussion started by: sushma123
3 Replies
4. Shell Programming and Scripting
Bash/Oracle Linux 6.4
A basic requirement.
How can I get nth line of a file printed ? Can I use grep in this case ?
Example:
In the below file, 12th line is "Kernel parameter check passed for rmem_max" . I just want the 12 line to be printed.
# cat sometext.txt
Kernel version check... (2 Replies)
Discussion started by: John K
2 Replies
5. UNIX for Dummies Questions & Answers
Hey,
I'm sure this is answered somewhere but my Googling has turned up nothing. I have a file with data in the following format:
<desription of event> at <time and date>The desription of the event is variable length and hence when the list is displayed it is hard to easily see the date (and... (8 Replies)
Discussion started by: RECrerar
8 Replies
6. Shell Programming and Scripting
Dear all,
How to print every nth line. File like this:
File input:
1
1
1
1
1
1
2
2
2
3
3
3
3
3
3 (3 Replies)
Discussion started by: attila
3 Replies
7. Shell Programming and Scripting
Hi,
Is there any short method to print from a particular field till another filed using awk?
Example File:
File1
====
1|2|acv|vbc|......|100|342
2|3|afg|nhj|.......|100|346
Expected output:
File2
====
acv|vbc|.....|100
afg|nhj|.....|100 (8 Replies)
Discussion started by: machomaddy
8 Replies
8. Shell Programming and Scripting
I have a growing file . I knew only last few lines which is constant for evey job run. I'd need to pull the Nth record from the last line. In this case i should not use search pattern. (2 Replies)
Discussion started by: ford2020
2 Replies
9. UNIX for Advanced & Expert Users
I have i got a requirement like below.
I have input file which contains following fixed width records.
00000000000088500232007112007111
I need the full record and concatenated with ~ and characters from 1to 5 and concatenated with ~ and charactes from 10 to 15
The out put will be like... (1 Reply)
Discussion started by: ukatru
1 Replies
10. UNIX for Dummies Questions & Answers
I have a comma-separated record and I'd like to use sed to pull the Nth record from it.
It seems like it'd need to be something like this: sed -n 's/'"\,$1\,"'/&/p'
Am I close? (3 Replies)
Discussion started by: doubleminus
3 Replies