pwsh & Explore Some Cmdlets
PowerShell is now installed — this section demonstrates how to launch pwsh and begin exploring the PowerShell environment using common cmdlets and pipeline operations.
After installing PowerShell, you can launch it directly from the Ubuntu terminal by typing pwsh. This opens a PowerShell session running on .NET Core, complete with full pipeline support, object-based output, and cross-platform compatibility.
The following examples illustrate how PowerShell interacts with the Linux filesystem, retrieves process information, and searches output using both PowerShell and native Unix-style commands.
pwsh
PowerShell is started on Ubuntu by typing pwsh into the terminal.
Once launched, the banner displays the installed PowerShell version and the environment switches into a PowerShell session.
In this example, the user runs:
Get-Item /var/log | Select-Object Name — retrieves directory information as a PowerShell objectGet-Process | Sort-Object CPU -Descending | Select-Object -First 5 — lists the top CPU-consuming processes
PowerShell supports execution of native Linux commands directly inside the session. In this example, a standard Linux pipeline is used:
ps -aux | grep cron
This searches for any running cron processes and outputs matching results. This demonstrates PowerShell’s hybrid flexibility: you can seamlessly mix PowerShell cmdlets with traditional Unix commands in the same terminal session.