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
-
which
=>Get-Command
-
head
(I don't needcat
) =>gc log.txt | select -first 5
Top comments (5)
I use
cmd.exe
and occasionally Git-bash when it is required for a projects build setup or something. I rarely use commands other thanmkdir
andcd
because I mainly just use Yarn or NPM CLI commands along withcode .
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
.devblogs.microsoft.com/commandline...
Thanks. I totally forgot that I can do that, no matter
cmd.exe
or PowerShell.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
touch
command to create new files. I am not sure either what is the purpose of modifying file timestamps.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...