4 votes
Accepted

get all lines except x to y

Your sample command is indeed the inverse of what you want. Read the man page and note that -n disables sed's default behaviour, which is to print each line that is processed. You disable the ...
user avatar
  • 5,835
3 votes

get all lines except x to y

A function can be preceded by a ! character, in which case the function shall be applied if the addresses do not select the pattern space. (source) In your case the function is p and the addresses ...
user avatar
3 votes

Show changes between consecutive lines of a file

awk '{ bak=$0; for(i=1; i<=NF; i++)$i=($i==tmp[i]?"-":$i) split(bak, tmp) }1' infile cpu1 cpu2 cpu3 cpu4 5 3 3 6 - - - - - 0 - - 3 - 6 - 5 3 3 0 To keep the records indentation (...
user avatar
  • 38.7k
1 vote

Show changes between consecutive lines of a file

It's true: this is not a code writing service. But if a task is easy or fun, some of us act as one. (-; Assuming you can't write programs, you still can use sed, no real one-liner with such a line ...
user avatar
  • 12.3k
1 vote

Where to find purpose of each system default Groups and Users in Linux

The answer depends on what system you’re using; there are a number of Q&As on the topic, on this site, such as: How to know which users / groups can safely be deleted? What Users should be ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible