Main Menu

Search

Showing posts with label Administrators Guide. Show all posts
Showing posts with label Administrators Guide. Show all posts

LINUX: AWK Command To Print Particular Column In Command Output Or File (How To Doc)

Below awk command can be used to print particular column in command output or file.
cat <filename> | awk {'print $<column number>'}
<command> | awk {'print $<column number>'}

To demonstrate this with an example, if you have file test.out with below content and 4 columns.

A789652=alpha   22      33      44
A789651=alpha   AA      BB      CC
A28ee69=beta    XX      YY      ZZ
A28ee6a=beta    11      99      88
A2991a5=alpha   12      34      56

If you want to print second column in test.out file, your awk command looks as follows:

# cat test.out | awk {'print $2'}

Below is example output of above command. As you can see it printed 2nd column.

22
AA
XX
11
12



Products to which Article Applies

All Linux Operating Systems

Additional Reference

http://linuxcommand.org/lc3_adv_awk.php

Oracle Virtual Server (OVS): Command To Get List of Running VM's with their names, UUID, uptime on Dom0 Hypervisor

Below command can be used.
clear;for i in `xm uptime|egrep -v 'Name|Domain-0' |awk '{print $2}'`;do h=`xm uptime $i|egrep -v Name|awk '{print $1}'`;z=`xm uptime $i|egrep -v Name|awk '{print $3}'`;y=`xm uptime $i|egrep -v Name|awk '{print $4}'`;j=`find /OVS/ -name $h`;o=`grep OVM_simple_name $j/vm.cfg|awk '{print $3}'`;echo VM Name: $o VM UUID: $h Uptime: $z $y;done

Below is example output of above command.
VM Name: 'NodeManager' VM UUID: 0004fb00000600001ec36fa6da3a1473 Uptime: 18 days,
VM Name: 'infi-1' VM UUID: 0004fb00000600002b1f8fd5ee95897d Uptime: 4 days,
VM Name: 'net-6' VM UUID: 0004fb000006000042f4d8d5087a8f4c Uptime: 4 days,
VM Name: 'net-2' VM UUID: 0004fb000006000045a845ecff3d8554 Uptime: 4 days,

Products to which Article Applies

Oracle Virtual Server (OVS)

EXALOGIC: System Administrator's Guide Documentation Links For Managing Exalogic Virtual Racks


Main Exalogic Cloud Administrators Documentation Link

https://docs.oracle.com/cd/E18476_01/doc.220/e25258/toc.htm

Create Cloud Admin and Users from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/roles.htm

Create Client Access EoIB Networks from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/proc.htm

Create vServer Types from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/proc.htm

Create vDC Account from EMOC(Cloud Resource Quotas/User Assignment/Tenancies)

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/advproc.htm

Uploading vServer template from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/app_vdc_cli.htm

Create Private vNets from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/proc.htm#BABEJCJD

Create Distribution Groups from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/proc.htm#BABDDFED

Create vServers from EMOC

http://docs.oracle.com/cd/E18476_01/doc.220/e25258/proc.htm#CHDIHDEI


_________________________________________________________

Products to which Article Applies


Exalogic Virtual Racks.

Additional References