These tips are for Windows users who are getting started with Linux via WSL.
Type
bash
at a PowerShell or command prompt to run bash.
Use bash inside ConEmu (see above).
From within bash,
-
the C drive is at
/mnt/c/
. -
pwd
outputs your current location. -
lsb_release -r
outputs your Ubuntu version. -
SOME_VAR="SOME_VALUE"
sets a local environmental variable. -
export SOME_VAR="SOME_VALUE"
sets a global environmental variable. -
printenv SOME_VAR
outputs the environmental variable -
ampersands separate multiple commands:
command1 && command2 && et cetera
- single quotes behave differently than do double quotes
Use PowerShell in the Linux subsystem for Windows.
- install PowerShell
- open a bash prompt
-
type
powershell
-
type
exit
to return to bash
Paste from the Window's clipboard into bash using right click.
Clear the current input using Ctrl + E + U .
Convert from dos to unix line endings in vim with this command
:set ff=unix
.
Pipe command output to file and show it in the sell
command |& tee output.txt
.
Window's
clip.exe
can be run from the bash shell to copy/paste. E.g.
`clip.exe < ~/.ssh/id_rsa.pub`
-
sudo apt-get install git
-
sudo apt-get remove git