These examples demonstrate how PowerShell handles files and directories inside an Ubuntu environment while comparing the commands you wouuld run normally in Linux for these tasks. From navigation and inspection to creating, copying, and removing items — this section builds a strong foundation for working efficiently in PowerShell on Linux.
ls and Get-ChildItem)
PowerShell supports both the traditional UNIX-style ls alias and the native cmdlet Get-ChildItem.
The output displays directory contents, including file metadata such as permissions, ownership, timestamps, and file sizes.
cd / Set-Location)
PowerShell provides multiple ways to change directories.
Whether using cd or Set-Location, both commands update your working path just as they would in Bash.
This step shows navigating into the Documents directory and back out into /home/mark.
pwd / Get-Location)
/var/log and Inspect FilesNavigating into /var/log, a common directory for stored system logs. Using Get-ChildItem, you can inspect log files and directories directly inside PowerShell.
cat / Get-Content)
PowerShell supports both cat (alias) and Get-Content for reading files.
This example shows examining the vbox-setup.log file to verify VirtualBox module builds.
mkdir / New-Item)
Directories can be created using either mkdir or the more explicit PowerShell cmdlet:
New-Item -ItemType Directory.
In this step, two test directories (Test1 and Test2) are created to demonstrate both methods.
rm / Remove-Item)
PowerShell on Linux supports UNIX-style removal via rm, as well as structured deletion through
Remove-Item.
This example removes the earlier test directories with both methods.
cp)
File copying works exactly as expected on Linux.
The cp alias maps directly to PowerShell’s Copy-Item, allowing files to be duplicated across directories.
This step shows copying multiple Linux-Commands files into a new directory.
touch / New-Item -ItemType File)
PowerShell supports both touch (alias) and explicit file creation with:
New-Item -ItemType File.
This step shows creating tw