Do you use PowerShell or
cmd.exe? Or something else, like Git-bash or WSL?
How do you learn commands? PS and
cmd.exe have different commands.
Some of commands I need are
head(I don't need
gc log.txt | select -first 5
Top comments (7)
If you have wsl1/wsl2 installed, any commands from wsl can be used in Windows land if you prefix it with wsl e.g
wsl touch file.txt.
Thanks. I totally forgot that I can do that, no matter
Surprisingly, this points to the correct answer.
Not to mention that these are useful
Though, I personally don't get the purpose of
wsl touch new.txt. I know it creates or modifies timestamp, but why?
I only have used the
touchcommand to create new files. I am not sure either what is the purpose of modifying file timestamps.
cmd.exeand occasionally Git-bash when it is required for a projects build setup or something. I rarely use commands other than
cdbecause I mainly just use Yarn or NPM CLI commands along with
PwerShell 7 always. Actually, being a lifetime Windows user makes me miss some stuff when I go to Linux-based Shells, mostly CUA keybindings. Nothing compares to PSReadLine for selecting text with Ctrl and Shift.
Also, my PS profile has a lot of stuff defined in it, so my environment is exactly the way I like it ;)
(Linux-like aliases are much better than the cmdlets full names btw, would hate to type
Get-ChildItemall the time XD)
For stuff that actually has to be run on Windows, PowerShell. It has default aliases that make it easier to adapt to from POSIX sh, and it’s far more capable than CMD even if you do have to quote things more.
In all other cases, I just boot into Linux when I need a shell environment for something...