Book Image

Learn Linux Quickly

By : Ahmed AlKabary
Book Image

Learn Linux Quickly

By: Ahmed AlKabary

Overview of this book

Linux is one of the most sought-after skills in the IT industry, with jobs involving Linux being increasingly in demand. Linux is by far the most popular operating system deployed in both public and private clouds; it is the processing power behind the majority of IoT and embedded devices. Do you use a mobile device that runs on Android? Even Android is a Linux distribution. This Linux book is a practical guide that lets you explore the power of the Linux command-line interface. Starting with the history of Linux, you'll quickly progress to the Linux filesystem hierarchy and learn a variety of basic Linux commands. You'll then understand how to make use of the extensive Linux documentation and help tools. The book shows you how to manage users and groups and takes you through the process of installing and managing software on Linux systems. As you advance, you'll discover how you can interact with Linux processes and troubleshoot network problems before learning the art of writing bash scripts and automating administrative tasks with Cron jobs. In addition to this, you'll get to create your own Linux commands and analyze various disk management techniques. By the end of this book, you'll have gained the Linux skills required to become an efficient Linux system administrator and be able to manage and work productively on Linux systems.
Table of Contents (24 chapters)

Parent process versus child process

A parent process is a process that has started one or more child processes. A perfect example will be your terminal and your bash shell; when you open your terminal, your bash shell is started as well.

To get the PID of a process, you can use the pgrep command followed by the process name:

pgrep process_name

For example, to get the PID of your terminal process, you can run:

elliot@ubuntu-linux:~$ pgrep terminal 
10009

The PID of my terminal is 10009. Now, let's get the PID of the bash process:

elliot@ubuntu-linux:~$ pgrep bash 
10093

The PID of my bash shell is 10093. Now, you can get the information of your bash process by using the -p option followed by the bash PID:

elliot@ubuntu-linux:~$ ps -fp 10093
UID PID PPID C STIME TTY TIME CMD
elliot 10093 10009 0 13:37 pts/1 00:00:00 bash

You can see from the output that the PPID of my bash process is equal to the PID of my terminal process. This proves that the terminal process has started...