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

CSS

position: absolute | relative This is referencing the first parent element. Absolute means it's removed…

PowerShell: Excute Function Remotely

$computername=$env:computerName $adminUsername='doeMainAdmin' $adminPassword='frackingPassword' $adminCredential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $adminUsername,$(ConvertTo-securestring $adminPassword -AsPlainText -Force) function execFunctionRemotely{ param( [Parameter(Mandatory=$true)][string]$computerName,…

Useful Ubuntu Settings for VNC

# Disable screensaver Ubuntu (Gnome) gsettings set org.gnome.desktop.screensaver lock-enabled false # Purge screensaver and update…