Bash on Windows– 10 Things I Learned Today

I’ve been playing today with Bash on Windows 10. I blogged earlier about how to install it. Now to getting down to use it. I spent a few hours today as a NEW to Bash user and found some differences. If you know Linux,  you may find some of these obvious but they do represent a difference new to Bash folks will find.

1. BOW is case sensitive  LS is not the same as ls. Windows is not case sensitive, so LS and ls are the same.

2. Getting help for a command is different and inconsistent between commands. In some cases it's <cmd> -h, some times <cmd> --h, or <cmd> --help, etc. Each command has its own way of providing help.    

3. The Unix MAN help system is alive and well in Bash. Type man <cmd name> for help. However, this takes you into a pager, from which you type q to escape.

4. You don’t have a graphical text editor in Bash. But you do have VI, and you can easily install emacs (apt-get install emacs23).

5. The Linux and Windows file systems are different. Windows has no single root, but a bunch of volumes C: d:, etc. With Linux there is one unified filesystem '/' with everything underneath it. 

6. You can see the windows file system from bash /mnt/c is c:, /mnt/d would be d:, etc. But interop is limited. It would be nice to be able to edit, say, over in Windows but use over in bash. That doesn't really work fully. You can, for example, mkdir /xxx from the bash side, and that folder shows up in windows. But create a file in windows and you can't see it from bash. I suspect this is a work in progress.

7. No GWMI Win32_Processor, instead cat /proc/cpuinfo , or  grep Intel /proc/cpuinfo (nb grep intel /proc/cpuinfo fails! - see rule 1)

8. The error messages are quite different.

9. Type Man Man and you can see where PowerShell help ideas came from!

10. Type the wrong command and you can often be told which where to find it (eg, type lsf and see what it offers you)

And since I can’t count well,

11. Getting packages is different - You use apt-get. apt-get install emacs, for example. PowerShellGet is modelled on APT-Get, it feels!

This is fun!

0 Comments