forked from kunal-kushwaha/DevOps-Bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kunal-kushwaha#25 from mananmehta3/patch-1
Create Commands For Windows.md
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
| 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>} | |