Linux Bootcamp Series
Operating System
- OS acts as an interface between User/Application and Hardware
- OS can interact with multiple devices (Device Driver might be necessary). This interaction complexity is abstracted from users/Applications
- OS also gives some System Applications and User Applications.
Categories
- Desktop Operating Systems:
- Example: Windows 10, Mac, Ubuntu Desktop, Fedora
- Users interaction on this server has to be simple.
- Generally GUI Based
- Server Operating Systems
- Examples: Windows Server 2016, Ubuntu Server, RedHat Linux, Open SUSE
- User interaction can be little bit complicated.
- Generally Non-UI / Terminal Based.
Linux Operating System
- Linux works on Desktops/Servers/Embedded Systems etc…
- Linux Kernel is the key component
- A Distribution (Parent Distribution/Platform) is built on top of kernel. Popular Distributions are
- Debian
- RedHat
- Andriod
- SUSE
- Companies like canonical etc take these parent kernels and they build the distributions which are most widely use. Some of Widely Used Distributions are
- Ubuntu
- Centos
- RHEL
Lab Setup:
- Ubuntu Linux Instance on AWS or Azure
- Windows:
- Git For Windows
Connecting to Linux Machine
- Any Linux Machine can be connected using SSH Protocol.
- Windows:
- Install Git For Windows
- SSH Command for LInux Machines with Username and Password
ssh username@ipaddress
- SSH Command for LInux Machines with Username and KeyFile(PEM)
ssh -i <path-to-pem> username@ipadress
Important Things to Consider
-
Shell:
- Helps you interacting with OS/Kernel
- Shell is a command line based
- Examples
- bash (Bourne Again Shell)
- zsh
-
Commands:
- Commands perform some action.
- Command has a syntax
<command> <paramters>
-
Parameters:
- Parameters are of two kinds, Positional Parameters and Named Parameters.
-
Positional Parameter:
- directly entering the value of parameter
- Examples:
ping google.com mkdir test mv /tmp /temp
-
Named Parameter:
- Will have associated name with every paramter you enter
- Examples:
ping -c 10 google.com # -c is named paramter which has a value of 10 ansible-playbook --inventory hosts test.yml # --inventory is named parameter which has value of hosts
- Named parameters generally have two forms
- short form:
- eg: ansible-playbook -i hosts test.yml
- long form:
- eg: ansible-playbook –inventory hosts test.yml
- short form:
-
Manual:
- Every Linux command has a help which is called as manual.
- To look at manual of any command use
man <command>
- Examples:
man ls
Sample Commands to be executed
1. Display Linux System Information
# Display Linux system information
uname -a
# Display kernel release information
uname -r
# Show which version of redhat installed
cat /etc/redhat-release
# Show how long the system has been running + load
uptime
# Show system host name
hostname
# Display the IP addresses of the host
hostname -I
# Show system reboot history
last reboot
# Show the current date and time
date
# Show this month's calendar
cal
# Display who is online
w
# Who you are logged in as
whoami
Create a folder structure use mkdir and touch
- ecommerceapp
- src
- main.py
- test
- main.py
- docs
- main.md
- Readme.md
- src
very nice blog for learning