Linux
open-source operation system
Why Linux?
Ansible do not run on Windows
Kubernete do not plan to run on Windows
Distro
KALI LINUX ™, Ubuntu, and Parrot all come from Debian.
CentOS comes from Red Hat.
Shell
The shell is the command-line interpreter.
Type of shell:
Bourne-Again Shell (bash)
C Shell (csh)
Korn Shell (ksh)
Enhanced C shell (tcsh)
Z Shell (zsh)
CLI
SSH
Package manager
A package manager is a tool that helps users install, manage, and remove packages or applications. Linux uses multiple package managers.
.rpm
.deb
Services
# start a service, e.g: httpd
service httpd start
# or
systemctl start httpd
systemctl stop httpd
# check status
# which file the service configured
systemclt status httpd
thor@host01 ~$ systemctl status app
● app.service - My python web application
Loaded: loaded (/usr/lib/systemd/system/app.service; disabled; vendor preset: disabled)
Active: inactive (dead)
# enable, disable after configuration
# when enable, the service start automatically when system boots up
systemctl enable httpd
systemctl disable httpd
[app].service
thor@host01 ~$ cat /usr/lib/systemd/system/app.service
[Unit]
Description=My python web application
[Service]
ExecStart=/usr/bin/python3 /opt/code/my_app.py
ExecStartPre=/bin/bash /opt/code/configure_db.sh
ExecStartPost=/bin/bash /opt/code/email_status.sh
Restart=always
[Install]
WantedBy=multi-user.target
Last updated