0% found this document useful (0 votes)
5 views1 page

Commands For Windows

The document provides a comparison of ZSH and PowerShell commands, highlighting their equivalents for various tasks. It includes commands for file manipulation, directory management, and system information retrieval. Additionally, it notes specific requirements or differences in syntax between the two shells.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Commands For Windows

The document provides a comparison of ZSH and PowerShell commands, highlighting their equivalents for various tasks. It includes commands for file manipulation, directory management, and system information retrieval. Additionally, it notes specific requirements or differences in syntax between the two shells.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

| ZSH Commands | PowerShell Commmands |

| --- | --- |
| where | where.exe |
| open | Use Shortcut- Win + R|
| $PATH | $Env:Path |
| ls -a </br> [To see all files[hidden and visible]] | dir -Force |
| vi | vim </br> [need to download] |
| ls -l </br> [To see all files & directories] | Get-ChildItem |
| cat > </br> [To edit] | vim |
| cat file.txt two.txt > total.txt | cat file.txt, two.txt > total.txt |
| cat file.txt \| tr a-z A-Z > upper.txt | (cat 'file.txt').ToUpper() > upper.txt |
| \ </br> [For new line] | ` |
| mkdir random </br> mkdir random/hello </br> [we need to create random first here]
| mkdir random/hello </br> [only one line to execute, no need to create random
first, it can be created together] |
| touch | [you need to define touch] </br> function touch { </br> Param( </br>
[Parameter(Mandatory=$true)] </br> [string]$Path </br> ) </br> if (Test-Path -
LiteralPath $Path) { </br> (Get-Item -Path $Path).LastWriteTime = Get-Date </br> }
</br> else { </br> New-Item -Type File -Path $Path </br> } </br> } |
| sudo | runas |
| df | gdr |
| du | [need to define du] </br> function du($path=".") { </br> Get-ChildItem $path
\| </br> ForEach-Object { </br> $file = $_ </br> Get-ChildItem -File -Recurse
$_.FullName \| Measure-Object -Property length -Sum \| </br> Select-Object -
Property @{Name="Name";Expression={$file}}, </br>
@{Name="Size(MB)";Expression={[math]::round(($_.Sum / 1MB),2)}} # round 2 decimal
places </br> } </br>} |

You might also like