LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2016, 06:31 PM   #1
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
Output of a command in the right format? grep/tr/cut?


Hi Linux Friends,

Here is a command output

+--------------+--------------------------------------------------+
| accountname | Clients |
| address | 1.1.1.1 |
| devicename | MyDI Vcenter |
+--------------+--------------------------------------------------+
| accountname | Safety |
| address | 2.2.2.2 |
| devicename | MyDI Vcenter |
'--------------+--------------------------------------------------'

How do I get the output appears only like this?

+--------------+--------------------------------------------------+
| accountname | Safety |
| address | 2.2.2.2 |
| devicename | MyDI Vcenter |
'--------------+--------------------------------------------------'

Thanks
 
Old 03-29-2016, 06:47 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If it always looks like that simply pipe it to tail.
 
Old 03-30-2016, 12:57 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
The general rule of thumb here is, the less information you provide, the more limited the answers will be.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cut/grep command help roopakl Linux - Newbie 5 04-29-2013 02:06 PM
print output in desire format using awk or cut command dipanjan Linux - General 1 12-15-2012 01:59 AM
[SOLVED] How to grep, cut, cat in a single command? dwarf007 Programming 6 04-27-2010 02:36 AM
How to use command grep,cut,awk to cut a data from a file? hocheetiong Linux - Newbie 7 09-11-2008 07:16 PM
grep and cut command tanveer Linux - General 3 09-05-2008 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration