You Need to Learn How to Use the Termina ...

You Need to Learn How to Use the Terminal (Right Now!)

Jun 04, 2022

https://www.youtube.com/watch?v=CBHTFzVm84A

Intro

Hello everyone this is Mirko. In today's episode I will show you something that you're probably avoiding since you've started to learn how to code or you've been programming all your time on Windows and then you've switched for some particular reason, to a Unix-based environment where everything is different to you. You still can use your mouse to drag 'n drop things but this is not the case ... not anymore !

That's because I'm here today, but before make sure to watch this video until the end, hit the thumbs, comment and share. You can also subscribe in my channel or donate any amount via paypal or on buymeacoffee.com! I will provide the links down below the description, make sure to check them!


Top Reasons on Why to Use a Terminal

In this part I would like to introduce you first the reasons why you should use a terminal instead of doing all the operations inside your system, manually. Then, I will show you some useful commands to start with. Ok, so the

  1. First reason is you avoid corrupting the system in your device by enabling unnecessary settings. Especially on Windows where you do actually have the system pre-installed, yet you need to tweak some change, move the files in different directories and so on. Normally, in a Unix based system you'd open the terminal and type sudo to enable the admin privileges and then you utilise the command next to it, that can be a package manager to install some software or access the protected folders

  2. The second reason that comes after is speed. Basically every command you provide does exactly the job for you without losing precious time and at least 5x faster, instead of doing things graphically. Now, depending on your device specs the operations time will last according to these, still the process itself remains faster

  3. Third reason here is the ability to install software. If you are a Windows user, you probably install all the software you need, by going to the internet, browse there for the application you want to install and the you click the installer and so many steps to install the app in the end. However, this approach is a potentially risk or harmful process, as you probably have downloaded a malware and the hackers have now access to your pc and start to corrupt things down there. So as you can see, by using a terminal you avoid an important topic as the security issues. On unix based systems such as macOS, Linux, BSD etc, you usually have a package manager that allows you to install your app via the terminal, by simply typing the installer command. All of this is possible due to the fact that almost every apps you probably want to install are pretty much famous, thus are accessible by the online repository offered by your system.

  4. Another reason is for us software developers or engineers, such in my case, we utilise the terminal to help the cycle development. You'll be wondering how, well, the terminal provides immediate access to the file system, the compilers, the database, so it is possible to access and run the code in the terminal, such in case of a web server application, or a script and so on. Not only, you can use the terminal to version your software project, by utilising versioning softwares such as git, altogether with online services such as GitHub or GitLab.

  5. Last but not least, you get to know better your system and become versatile with it, so every problem that can emerge, you'd probably know how to fix it, even a small issue.

Now I will move to the part where I show you some action on the terminal


Terminal Action

Ok I will start with some file system operations. By default the terminal sets the directory to your Home folder if you're in Linux or BSD, whilst on Mac your home folder is called Users.

mv - move a file or object to another directory in your system

cp - copy  a file or object to another directory in your system 

rm - remove a file or object to another directory in your system

You can also add tags while you do such operations, I'm not gonna show you in this video, if you want to learn more about or want me to make another video, let me know in the comments below.


Installing Apps

As I mentioned before you can also install apps via a package manger. I'm utilising Ubuntu, it has apt as its default package manager, so to install a text editor like vim or neovim you can type the following

$ sudo apt install neovim -y

And after the text editor is installed, is possible to access it immediately by typing on the terminal the name of the app we just installed. Depending, from the system you're currently using, it's important to note here, that every system has its particular package manager , so the above command is only valid for Linux distros based on Debian an/or Ubuntu.


Versioning of the Software

The most popular versioning tool is git which is also open source and does work very well with every online services such as GitHub or GitLab. Typically, you use git command to control the flow of your project while you're developing.

For example, you can initiate an empty folder and initiate the git versioning in order to have the history of your workflow available, so:

$ mkdir example/

$ git init

$ touch .gitignore

$ touch README.md

$ git add .

Now with these commands, I did initialised an empty folder name example with the command mkdir, initialise the git versioning with the command git init, added some file with the command touch and then added the files to the workflow history with the command git add . As you can see, this approach is way faster compared to the official GitHub Desktop app.


Outro

That is it for today guys, these are some examples on why you need to learn how to use a terminal, if you want a more detailed video, just let me know in the comments below. Don't forget to subscribe, hit the like button, comment and share my videos. You can follow me in my social media accounts, or access the Discord server, so we can create our community linked to this channel. See you in the next episode.

#linux #software #engineering #wsl #microsoft #windows #terminal #console #diy #howto #how #learn #now #mirkolantieri #live #video #seriesturcas

Enjoy this post?

Buy Mirko Lantieri a coffee

More from Mirko Lantieri