← All commands
Topic hub PowerShell Equivalents
Windows Linux PowerShell Equivalents Expanded guide 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

On Windows, "PowerShell Where-Object" is used to filter records. On Linux, the closest practical mapping shown here is "awk CONDITION". Keeps only lines or fields that satisfy a textual or numeric condition. This reference is grouped under PowerShell Equivalents → Text Processing.

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

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows PowerShell Where-Object maps to awk CONDITION for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

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

Debian/Ubuntu, Fedora and Arch all use "awk CONDITION" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

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