How I Started to Love the Shell and Why PowerShell is Awesome
I would still love to hear your feedback in the comments below. Enjoy!
I’ve been using Windows 7 for a couple of years now and only recently I found PowerShell. If I didn’t hear about it, maybe you haven’t either, and I would love to correct that. But first, an obligatory story.
On my second semester in the university, I took a course called “Introduction to Systems Programming”. It’s a course where you learn advanced C and then move on to C++, but first you learn c-shell 1. A further requirement for this course is that your C/C++ projects will compile on the university’s Linux server, where it’ll be tested. What most people do when taking this course is that they use some sort of Windows IDE like Visual C++. Then, usually at the eleventh hour, they copy their code to the Linux server via SSH (which is painful if you’re not POSIX-literate) and then have to solve all sorts of weird NT-Linux, gcc-VC comparability issues. Why aren’t students POSIX-literate? Because there’s only so much you can learn without using it “for real”.
I decided to use it for real.
I backed up all my data and documents on my laptop (thank god I also had a desktop - so I can play Civilization 4) and installed Ubuntu. I was going to do this the right way. It wasn’t the first time I tried using Linux, but in the past (as a highschool student) I usually gave up after a few days since it was uncomfortable. But with Ubuntu I lasted all semester. It was tough. There are Windows idioms that are very difficult to shake, like using My Computer as an anchor point for directory movements. I didn’t become a Linux expert, but I was way above the pack where it came to using the shell to do… well, anything. However, since Ubuntu is very user-friendly (as far as UNIX systems go) there were still lots of stuff I was doing in a pseudo-Windows style - like copying files, which I did by opening two windows and using drag & drop.
Then, on my third semester, I got a job at Intel. We were using Windows laptops and VNC to connect to actual Linux machines where we did our actual programming work. When I got my VNC set up, it was some sort of weird, antiquated x-window manager (it was fvwm2 if I remember correctly). It wasn’t configured to anything comfortable and being that it was my first job ever, I was a bit shy about asking someone to help me with it (yeah, geeks are sometimes shy). Words can’t describe how much it sucked, but just to give you a taste - there wasn’t any open-windows-bar or anything. If I wanted to find an open window, I had to manually move other windows around until I found the one I’m looking for. I used it for a whole year.
While it sucked, after about a year of using it, I found that I was getting more and more proficient in using the shell at a very high pace. I literally had to use it for everything. At the end of that year I decided I had enough and that it’s time to use a real desktop manager, but my experience with bare-boned Unix was something I do not regret for one minute.
I never use drag & drop to copy files on a Unix machine.
Why am I telling you all this? Well, my new job has me programming with Python on a Windows machine, but using the Windows command line to do stuff drove me mad. I started looking into using bash on Windows, but to no success. It’s also not a very good solution, as sometimes I use other people’s prompt-snippets. And then someone told me about PowerShell. PowerShell is a built-in command prompt replacement in Windows 7. It’s completely backwards compatible and supports POSIX commands out-of-the-box, like ls, grep, tail, pipelining, etc. It’s not perfect, but considering it’s built in in Windows 7, it’s my shell of choice for Windows machines for the foreseeable future.
c-shell is bad for you, yadda-yadda-yadda. ↩︎
Follow me on Twitter, Facebook or Google+