Learn to get neat, clean and tabbed output of bdf.

Requirement :
bdf command output normally looks scattered especially when VG names are long. It will be difficult to grep out proper pattern out of such output. Also, its not convenient to share this output over email/document when extra lines breaks exists.
In such scenarios, we need to have proper formatted output of bdf. Also sometimes we require output with all its column left aligned.

Solution :

To remove line breaks from bdf output and get single row per entry output
See below normal bdf output. Note that last 2 mount points has two line entry since filesystem column has long entry.
Now with inline awk we format the output to have one entry per row. Check below command output.

To get left aligned bdf output
In above output, columns are not aligned properly. We can even do that with below argument.
Please make a note that this awk wont remove any line breaks from output. So one can combine (with pipe |) both awk to get left aligned output with line breaks removed.

Left aligned output with line breaks removed!
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment