Some people may not realize there are a lot of Linux commands that work within PowerShell. I thought I would list some of them for people to try. In the future I will do a write up on each one individually. For now, let's just get familiar with them.
- cat - Lists contents of files to the terminal window.
- cd - Change directory
- clear - Clear the terminal window.
- cp - Copy file
- curl - Retrieves information and files from URLs or internet addresses.
- date - Shows current date
- diff - Compares two text files and shows differences between them.
- echo - Prints a string of text in the terminal window.
- exit - Exit your current shell.
- finger - Shows information on user.
- find - Search for files.
- history - Brief list of the last few commands you have used.
- kill - Kill a running process.
- ls - List the files and folders in the current directory.
- man - Show man pages.
- mkdir - Create a directory
- mv - Move a file or directory.
- ping - Tool to help verify network connectivity.
- ps - List running processes.
- pwd - Prints current working directory to the terminal.
- rm - Remove a file.
- rmdir - Remove a directory.
- ssh - Connect to a remote computer.
- tar - Create archives.
- wget - Downloads files served with HTTP, HTTPS, or FTP over a network.
- whoami - Find out who you are logged in as.
Please play around with these in your terminal. Let me know if there are any I may have missed and I can add them.
Top comments (14)
It’s a great resource. Recommend that you change the commands with markdown code using the back ticks. Also, believe if you run
Get-Alias *
, you should get a list of all these Linux native commands that have been used to represent a PowerShell command.what about operators such as
|
(pipe)>
(create from scratch) or>>
(append to file or create)?also, if
sed
orgrep
orawk
would work in there too, I might update some of my bash scripts to work in PowerShell too. Thanks.P.S. it'd be cool if
${1}
and other variables are reachable as well, having just commands but no way to cross send parameters via shell is 1/3rd as useful.These aliases trip me up. If I type
rm -r -f *
I get an error about ambiguous arguments between-force
or-filter
, and I need to change the flag torm -r -fo *
.I also lost half an hour figuring out why
curl
was respecting the system default proxy in one terminal window but not the other. After that I turned off a bunch of aliases.Did you try
rm -rf <file or dir>
? That’s what I usually use if I’m in PowerShell.I tried it; I get
Remove-Item : A parameter cannot be found that matches parameter name 'rf'
. TheRemove-Item
cmdlet doesn't have a param starting withrf
... Is yourrm
not aliased toRemove-Item
?I was surprised to learn I could create a file via
touch
. It's not quite as cool as PowerShell'sNew-Item
but it totally worked. Touch didn't make the list here but it got me thinking and that's how I found this post. Thanks for writing it!Excellent! thank you for listing these, just started using the new Windows terminal and I have much love for it
What about netstat? That also works in linux and windows.
I generally use
ifconfig
...Really useful, not: finger.
finger works for me? weird. Here is the doc for using it from MS.
docs.microsoft.com/en-us/windows-s...
Who runs a fingerd nowadays?
To be honest, I have no clue. But it it worked as I ran through all the commands I could think of.
some of them work in cmd also like ping, cd, ssh and mkdir.