nixCraft,
@nixCraft@mastodon.social avatar

Here is how use awk with a regular expression to match lines containing the word "nginx" and the first fireld must be "ii". In other words, it will show all installed nginx package names on your Debian or Ubuntu Linux:

awk '$1 == "ii" && /nginx/ { print $2}' <<<$(dpkg --list)

realcainmosni,
@realcainmosni@mastodon.me.uk avatar

@nixCraft Why do you insist on using the <<< redirect? It's completely and utterly pointless in the examples you've given with dpkg. Just use a pipe.

objectvoice,
@objectvoice@mastodon.social avatar

@nixCraft awk and send are true powerhouse tools of the world. Makes me want to revisit my bathroom technology tutorial series using .

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines