Thoughts on the command line: what and how do I learn?

Hello everyone! Happy Monday! I wanted to ask some questions about the command line.

  • What shell do I use? (bash, PowerShell, etc…) (I’m on Windows 10)

  • What is the use in web development?

  • What are tools I can use to learn it?(courses, books)

  • (BONUS if you can) Is WSL on windows worth learning?

I want to be able to understand and leverage the command line for tests, scripts, and interfacing + installing packages.

Thanks!
Best,
Cy499_Studios

What shell do I use? (bash, PowerShell, etc…) (I’m on Windows 10)

I don’t think it matters much. And there is so much overlap that I don’t worry about it. My instinct is to start with the most basic, bash, but hey, whatever works.

What is the use in web development?

Not as much as say a system admin, but you still do need it. Often you are using things like webpack to develop in a Node environment and being able to do basic navigation and manipulation. I like to handle git from the command line. Sometimes you need to make things like curl requests or set permissions. There have also been a few times that writing a simple bash script has saved be a lot of hassle.

Sure, there are some GUIs that make some of these things easier, but still, there are times when you have to get out a wrench and get dirty.

What are tools I can use to learn it?(courses, books)

I don’t know. I just kind of learned it as I went. I might recommend just finding a youtube video on the basics and then just start using it. As you find things you don’t understand, look them up. I don’t know how much value there is in becoming a bash expert, but it probably also wouldn’t be worthless.

(BONUS if you can) Is WSL on windows worth learning?

Sorry, I am not familiar.

1 Like

Thanks @kevinSmith !

I suppose I should focus on finishing JavaScript, but I also wanted to elaborate a bit more on my questions,

What do you use? Because I think it Kinda does matter, on windows anyways (its a bit finicky for some things).

Can you give me an example (or the actual story behind this) of how this worked? I have some ideas on how to automate some things and create tasks for VS code, but I would like to hear about some of your experiences.

Trust me I don’t see much value in being an expert either, but I sometimes use Linux (my spare laptop) and I feel like on Windows 10 has an unusual way of leveraging the command line. I will also definitely start checking out YouTube but it’s the last place I want to go (long story no questions) but it seems like the best option at this point. I also want to transition from the VS Code Git GUI to the command line just to have a bit more control.

best,
Cy499_Studios

I just use the basic bash. I develop on linux at home and mac at work. I used to use Windows. I always used whatever was standard - I never learned the differences. I would expect that the differences would be minor - an mv will still be an mv.

Now that I think of it, I think my work mac has zsh on it, but it’s basically the same. The only thing I’ve noticed is some different file names for bash profiles - very minor stuff, so much so that I forgot about it.

Can you give me an example (or the actual story behind this) of how this worked?

We have a script at work that moves a bunch of files around and manipulates them for install. If we did it by hand it would have about five minutes and would be prone to mistakes. I wrote a script once to list out all React files by line length. I wrote a script to set up and run a bunch of test scripts and output them the way we want. I’m sure there are others - just little things, time savers.

I think you should just get as deep into bash as you need. It will really depend on what type of work you do.

1 Like

When I develop on windows I use Powershell. I haven’t looked into WSL due to laziness, but powershell works 99% of the time for what I need.

Powershell is essentially the “mainstay” for windows. If you wanted to be a system admin, it can be your best friend. Doing something like WSL could work, but you also might end up fighting the interop more than actually doing something.

Alternatives like git-bash, cmd aren’t as mainstream and you end up with a similar problem as WSL, where it might stop working if your doing something different. Powershell can have this same problem, especially if you start trying to do bash stuff, but there are more resources to work around such scenarios.

There are multiple ways to “automate stuff” in VSCode, but I don’t believe powershell is one of the top options unless you want to get vendor locked into powershell. If your doing a web-dev project, the most you’d use powershell is to call npm scripts that do all of what you describe. This way the “scripts” you run are nodejs based and written in JavaScript. This is just an example however.

This doesn’t mean you can’t learn to use Powershell, but you probably would use it to automate stuff within Windows itself.

For example, I remember I was given a project to move around around 20k images. I had to restructure the images based on their name and size into a new folder structure and rename them following a new format. Obviously a single human working on this manually would take a while, so the only option was to automate it.

It took about a day and a half to learn and write up the script to get the meta-data, and test it with a few hundred files. Worked pretty much flawlessly after only a day and a half of work, and the person who gave me the project was very happy.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.