Skip to content

Instantly share code, notes, and snippets.

@nax3t
Created June 19, 2023 22:50
Show Gist options
  • Save nax3t/cb393d3050f8d55d53c11b0536c970e9 to your computer and use it in GitHub Desktop.
Save nax3t/cb393d3050f8d55d53c11b0536c970e9 to your computer and use it in GitHub Desktop.
Bash Equivalent Commands for Powershell
Task PowerShell Command macOS Bash Terminal Command
Current directory Get-Location pwd
List files and folders Get-ChildItem ls
Change directory Set-Location <path> cd <path>
Create a directory New-Item -ItemType Directory -Name <name> mkdir <name>
Create an empty file New-Item -ItemType File -Name <name> touch <name>
Copy a file Copy-Item <source> <destination> cp <source> <destination>
Move/rename a file Move-Item <source> <destination> mv <source> <destination>
Remove a file Remove-Item <file> rm <file>
Remove a directory Remove-Item <directory> -Recurse rm -r <directory>
Display file contents Get-Content <file> cat <file>
Edit a file code <file> code <file>
Search for a file Get-ChildItem -Recurse -Filter <name> find . -name <name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment