- Use Linux, Mac or any other Unix-like OS as your primary computer at home
- Never use GUI for copying files, compressing, extracting, moving, renaming etc.
- When you don’t know the command to do something just google it as you go
- When you see that you run the same commands at least two times – write a script
No. 1 is easy – if you have an old laptop lying around then just install Ubuntu or any other Linux distro and you’re ready to go. If you have a Mac then you already have what you need.
No. 2 is important. The point is not to read a book or two and do few silly exercises a day in the command line and then go back to the GUI to do all your real work, but to do your regular work in the command line in the first place. Just start from things like creating directories or moving and copying files and if you learn anything new that you can do in the terminal, just keep doing it in the terminal from now on. Eventually you will write those commands automatically without even thinking about them.
No. 3 is just a way to learn things that you need – not things that someone else thought you would need. You will learn the most basic things like changing directories in few minutes but considering millions of different things that you may need to do, no one will tell you what you need to learn and in what order.
No. 4 is not as hard as it seems. Every command that you enter in the terminal can be written to a text file and you have a script already. For example – you need to count .txt file in your home directory? A minute of googling will give you a command like: “ls ~/*.txt | wc -l” (without the quotes). Don’t want to remember that? Make a text file called count-txt or something with #!/bin/sh in the first line and your command to count files in the second line – and you already have your first script – just run “sh count-txt”. Now to run it conveniently from other directories you will likely learn about file permissions, the PATH environment variables etc. but you’ll learn it as you go.
Eventually you will see that you can do a lot of things much faster from the terminal than it would be with the GUI.
I just use the command line and whenever I don’t know how to do something, I just look it up. After some time you notice that you just tend to look things up much less often, that’s all. You never have to learn it explicitly.
You never suddenly “become” an expert in anything and Unix shell scripting is no exception.
How do you become an expert driver? You drive a lot. The same is with scripting.