Skip to content

Commit 39cadc5

Browse files
Merge pull request #25 from mananmehta3/patch-1
Create Commands For Windows.md
2 parents d92adfa + ca89030 commit 39cadc5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
| ZSH Commands | PowerShell Commmands |
2+
| --- | --- |
3+
| where | where.exe |
4+
| open | Use Shortcut- Win + R|
5+
| $PATH | $Env:Path |
6+
| ls -a </br> [To see all files[hidden and visible]] | dir -Force |
7+
| vi | vim </br> [need to download] |
8+
| ls -l </br> [To see all files & directories] | Get-ChildItem |
9+
| cat > </br> [To edit] | vim |
10+
| cat file.txt two.txt > total.txt | cat file.txt, two.txt > total.txt |
11+
| cat file.txt | tr a-z A-Z > upper.txt | (cat 'file.txt').ToUpper() > upper.txt |
12+
| \ </br> [For new line] | ` |
13+
| 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] |
14+
| 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> } |
15+
| sudo | runas |
16+
| df | gdr |
17+
| 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>} |

0 commit comments

Comments
 (0)