Posted On January 22, 2021

Linux: GREP Training

kimconnect 0 comments
blog.KimConnect.com >> Codes , Linux >> Linux: GREP Training

Lorum Ipsum – let’s learn about grep, ya’ll

Examples:

# Get information only on the VGA device
vgaDevice=$(lspci|grep VGA) # find the VGA device line
vgaDeviceId=$(echo "$vgaDevice" | grep -Eo '^[^ ]+') # select only the first word of a line
lspci -vs $vgaDeviceId # display PCI device by its ID

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Check Servers NSLookup of a Listener to Match Active Node IP

$servers="SQL01","SQL02","SQL03","SQL04" $listener="halistener01" $activeNode="10.10.10.5" # Dynamic Credential method 1 $who = whoami if ($who.Substring($who.length-2, 2)="-admin"){$username=$who;} else…

PowerShell: Check Servers on Domain to Locate A Domain Account Being Set to Run Services and Scheduled Tasks

# Obtain the name of the default domain Administrator account (this account is expected to…

PowerShell: Quickly Start Services that were Set to Auto

Quick Liners: # Command to checkGet-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Format-Table -Auto…