We are about to delve into shell scripting. Shell scripts are used to automate certain things related to files.
It is good to be acquainted with shell scripts if you are a software developer, but if you are a regular user, read this only if you are interested. The aim of this section will be to get you familiar enough with shell scripting to read and write shell scripts, albeit you will need to Google certain details of the things you are trying to achieve (if you are writing your own shell scripts). We will do this by making a very simple shell script which demonstrates the usage of each of the constructs we will learn to use.
Use cron to schedule things periodically; use at to schedule things only once
Every single computer in a computer network has an IP address through which it can be addressed
ip command is used to see information about your network interfaces
Use ping someWebsite to check your Internet connection (you should have no packet loss)
Use ssh to login to a remote host
Use scp for copying files to/from a remote host
X Window System is related to the Linux desktop
Build systems exist to ease the process of creating an executable from source code
To build something from source code do the following: 1. Download the folder with the source code; 2. Run ./configure; 3. Run make; 4. Run make install
You may sometimes need to build a program from source. If its package is not available (or if the package doesn’t contain the most recent version of the program), then you need to build the program from source.
Generally, the steps are:
Download the source code
In your Terminal (positioned in the source code folder), execute ./configure
In your Terminal (positioned in the source code folder), execute make
In your Terminal (positioned in the source code folder), execute make install
Here, you are basically instructing your build system to take the source code and make the executable files out of it. That’s all you need to know.
I found a great more in-depth tutorial here: (“How to Install Software from Source Code… and Remove it Afterwards,” n.d.)
Today I want to introduce you to the concept of a build system. To understand what a build system does, let’s first discuss some other things and then we will gleam an intuition behind build systems.
Let’s say you were compiling a program that used a lot of libraries. To remind ourselves, libraries have to be linked to our program to produce the final executable file. Those libraries can also be called dependencies – we depend on them (or, more precisely, on the functionality within them) to be able to use our program.
Now, imagine if our program depended on a lot of libraries. Let’s say thousands of them. I think you get a feeling that it would be pretty hard to manage all of that manually. We would have to tell the linker to look for all of the thousands of libraries and that is tedious. And one thing programmers don’t like is tedious.
Build systems take care of this problem (among other things). Build systems make managing dependencies very easy. One of the most popular build systems is make, which is used when building programs from source code – that is, when compiling programs from source code.
As the title says, not all programs are compiled. Your reaction might be: Gasp “That means that the last post was a lie?” “No”, I would respond. Read on.
There are two kinds of programming languages – ones that are compiled and ones that are interpreted. (Shotts, 2019) The compiled programming languages undergo the process described in the previous post. Interpreted do not. Interpreted programming languagesare executed line-by-line. So instead of taking the whole program and translating it into zeroes and ones, then linking it and forming an executable file, a program called interpreter goes line-by-line over the interpreted language’s source code and executes it as it encounters each line of the source code.
Interpreted languages are generally slower than compiled languages.
Hope you learned something new!
References
Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 375-376
In this article, I will mention a couple of key terms related to the Linux desktop. (Ward, 2014)
The first one is the X Window System. It is just a framework – think of it as “bare bones” of a GUI (Graphical User Interface) environment. It is up to other programs to build upon this “bare bones” and construct the graphical user interface. (“X Window System,” n.d.)
Desktop environment is a package that allows for cooperation of different applications in a graphical sense. For example, application A tells application B that it is 50% done with a certain task and the application B displays that on its status bar. GNOME and Unity are examples of a desktop environment.
Some other terms and their explanations: Window managers arrange windows on the screen and provide interactive decorations like title bars that allow the user to move and minimize windows. Common elements on desktop applications (such as buttons and toolbars) are called widgets. Toolkits are used to provide widgets because that speeds up development.
That’s it for this post. I never dug really deep into Linux desktop, but if you ever encounter any one of these terms, I hope you have some more clarity as to what they mean.
Hope you learned something useful!
References
Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 297-299
In this article, I will mention a couple of key terms related to the Linux desktop. (Ward, 2014)
The first one is the X Window System. It is just a framework – think of it as “bare bones” of a GUI (Graphical User Interface) environment. It is up to other programs to build upon this “bare bones” and construct the graphical user interface. (“X Window System,” n.d.)
Desktop environment is a package that allows for cooperation of different applications in a graphical sense. For example, application A tells application B that it is 50% done with a certain task and the application B displays that on its status bar. GNOME and Unity are examples of a desktop environment.
Some other terms and their explanations: Window managers arrange windows on the screen and provide interactive decorations like title bars that allow the user to move and minimize windows. Common elements on desktop applications (such as buttons and toolbars) are called widgets. Toolkits are used to provide widgets because that speeds up development.
That’s it for this post. I never dug really deep into Linux desktop, but if you ever encounter any one of these terms, I hope you have some more clarity as to what they mean.
Hope you learned something useful!
References
Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 297-299
To connect to a remote host (remote computer), use ssh. (Shotts, 2019) ssh will allow you to use the command line as if you were physically present on the other computer’s Terminal. The computer you are connecting to needs to run ssh server and you need to be running ssh client.
if you want to connect with a different username other than the username on your local machine.
Note: You most likely won’t be using this if you are a desktop user, but if you are a programmer, you will most likely at least sometimes be required to connect to a machine remotely.
Thank you for reading!
References
Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 234-238
If you ever need to edit connections, you can use nmtui. It came preinstalled with my Debian 10. It allows you to set your IP, among other things. I used it only once, but if you want more information, (and you can assume what I will say next) Google will give it to you.