← All commands
Topic hub PowerShell Equivalents
Windows Linux PowerShell Equivalents Text Processing

Windows PowerShell Where-Object equivalent in Linux

Keeps only lines or fields that satisfy a textual or numeric condition.

Windows PowerShell Where-Object
Linux equivalents
Debian/Ubuntu same command
awk CONDITION
Fedora same command
awk CONDITION
Arch same command
awk CONDITION

Overview

What this command does

Keeps only lines or fields that satisfy a textual or numeric condition.

Migration tip: Use grep for simple pattern matching and awk when conditions depend on fields or numeric comparisons.

Practical tasks

Common use cases

Filter records

Keeps only lines or fields that satisfy a textual or numeric condition.

ps aux | grep firefox

Filter by text

awk -F, "$3 > 1000" data.csv

Filter by a numeric CSV field

df -P | awk "NR>1 && $5+0 > 80"

Find filesystems over 80 percent

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

ps aux | grep firefox
awk -F, '$3 > 1000' data.csv
df -P | awk 'NR>1 && $5+0 > 80'

Walkthrough

Examples with explanations

ps aux | grep firefox # filter lines containing text
awk -F, '$3 > 1000' data.csv # filter rows by a numeric field
df -P | awk 'NR>1 && $5+0 > 80' # filter filesystem usage

Reference

Common options and variations

Command or optionUse
ps aux | grep firefoxFilter by text
awk -F, "$3 > 1000" data.csvFilter by a numeric CSV field
df -P | awk "NR>1 && $5+0 > 80"Find filesystems over 80 percent

Distro differences

Debian/Ubuntu vs Fedora vs Arch

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command awk CONDITION Same command on this distribution.
Fedora same command awk CONDITION Same command on this distribution.
Arch same command awk CONDITION Same command on this distribution.

Keep learning

Related PowerShell Equivalents commands