Raspberry Pi_Eng_20.2.2 How Shell Runs Commands

20.2.2 How Shell Runs Commands

20.2.2.1 Types of Kernel’s System Calls

● “fork” system call

This call is one of the system call methods that a process uses to execute another process. When a command needs to be executed, a child process is created and executed separately.

Raspberry Pi_Eng_20.2.1 Shell and script

20.2 Batch Run of Commands via Script

Here we will look at the script tool we use to process multiple commands in batch at once. We will discuss the concept of script, how to write a script, how to execute a script, and so on.

20.2.1 Shell and script

20.2.1.1 What is Script?

On Linux systems, Shell plays a central role in executing commands. Among the various Shell programs, BASH is specified as the default shell. BASH receives a command entered by the user in the terminal environment, interprets the meaning of the command, processes the command according to the specified method, and returns the processing result to the user.

Raspberry Pi_Eng_20.1.2 Manual Run and Automatic Run

20.1.2 Manual Run and Automatic Run

Based on the subject who instructs the processing, the processing method can be divided into the manual execution and utomatic execution can

● Manual execution

In this method, the user instructs to process certain commands. The user determines the required point of time for execution, and the user also determines the contents of the specific command to be entered for execution and instructs the command. The command to be executed here may be an individual command or a bundle of commands defined by a script. Whatever it is, the user will decide the start of the run.

Raspberry Pi_Eng_20.1.1 Individual Run and Batch Run

20.1 How to Run Command

There are several ways to execute commands in the Raspberry Pi system. Users can run them one by one, or the computer can handle them automatically. We will take a look at what methods can be used here.

20.1.1 Individual Run and Batch Run

Based on the number of command processed at one time, the processing method can be divided into individual execution and batch execution.

Raspberry Pi_Eng_20.0 Chapter 20 Batch Run and Automatic Run

Chapter 20 Batch Run and Automatic Run

Chapter’s Main Topics

This chapter describes the several ways to execute commands on a Linux system. You can execute commands one by one, or you can execute several commands at once. You can also run it manually or let the system run automatically.

In this regard, we will look at the Script tools we use to process multiple commands at once. We will also look at tools that can execute commands at regular intervals.

It includes descriptions on the following topics:
■ Individual execution and batch execution

■ Manual execution and automatic execution

■ Batch execution with script

■ Automatic execution with init script

■ Automatic execution by schedule

Raspberry Pi_Eng_17.6.2 Cleaning Program Package File

17.6.2 Cleaning Program Package File

During the process of installing or upgrading programs, the related program package file is downloaded and stored in the local repository “/var/cache/apt/archives/”. These files are not deleted and remain intact even if the program installation is completed or the program is removed. If these files continue to accumulate, it will take up unnecessary storage space in the system, so it’s a good idea to remove any files that is no longer needed.

Raspberry Pi_Eng_17.6.1 Uninstalling Programs

17.6 Uninstalling Programs and Cleaning Files

17.6.1 Uninstalling Programs

If you no longer need the installed programs, you should remove them. There are several ways to remove installed programs.

Raspberry Pi_Eng_17.5.1 Comparison of Installation by Source Distribution Method

17.5 Installing and Reinstalling Program

17.5.1 Comparison of Installation by Source Distribution Method

In the Raspbian operating system, it is standard to manage and distribute programs using the package repository, but you can distribute, install, and use programs without using this method.

Raspberry Pi_Eng_17.5.2 Installing Programs Distributed in Package Repository

17.5.2 Installing Programs Distributed in Package Repository

● “apt-get install” command – install program

When installing programs in the package repository, use “install” command in “apt-get” command.

Raspberry Pi_Eng_17.5.3 Installing Programs Distributed in Package Format

17.5.3 Installing Programs Distributed in Package Format

Of course, if the program is configured in a package format but is not registered in the package repository and distributed in a separate way, you can not use the APT tool “apt-get” command, and you have to use the low-level “dpkg” command.