Linuxby Avinash
Linuxby Avinash
By
Avinash Reddy Thipparthi
YouTube : https://youtube.com/@avizway
LinkedIn : https://www.linkedin.com/in/avizway/
WHAT WILL YOU LEARN TODAY..??
• What is Linux.?
• Why to use Linux.?
• What does Open Source Means.?
• Where to download the Linux Kernel Source Code.?
• Linux Distributions
• How to Practice Linux.?
What is Linux.?
Source : https://en.wikipedia.org/wiki/Linux
Why Linux.?
What is running on Linux.?
➢ Free
➢ Stable
➢ Supercomputers
➢ Secure
➢ Embedded Systems
➢ Open Source
➢ Robotic Operating Systems (ROS)
➢ Satellite Communication Systems
➢ Internet of Things (IoT) Devices
➢ Flight Simulators
➢ Bitcoin and Cryptocurrency Mining
➢ Advanced driver assistance systems
(ADAS)
Open-Source.?
Open-source software is software with source code that anyone can inspect,
modify, and enhance.
▪ We can access the Source code of the Linux OS.
▪ Allowed to run the program for any purpose / usage.
▪ Allowed to Change the program working procedure.
▪ Free to distribute.
https://www.kernel.org/
Linux Distributions
Debian-based distributions:
Ubuntu
Linux Mint
Kali Linux
• Init identifies the default init level from /etc/inittab and uses that to load all appropriate
program.
• When the Linux system is booting up, you might see various services getting started.
• In Simple, It is same as Windows startup programs.
• Runlevel default init settings will execute the programs from one of the this directories.
Run level 0 –> /etc/rc.d/rc0.d/ , Run level 1 –> /etc/rc.d/rc1.d/,
Run level 2 –> /etc/rc.d/rc2.d/ …………. Run level 6 –> /etc/rc.d/rc6.d/
• Chkconfig –list
Boot Issues:
/root : it is home directory for the root user (superuser). It provides the working
environment for the root user. (C:\Users\Administrator)
/home : It is the home directory for other users in Linux. It provides a working
environment for other users (other than root).
/bin : it contains commands used by all users (Binary files) i.e; ls, cp, mv
/boot : The /boot file system contains the Linux kernel, boot support files, and boot
configuration files for Linux. Holds files necessary for booting the OS.
/dev : it contains device files Like hardDisk: /dev/hda cdrom: /dev/cdrom (Similar
to device manager of windows)
/etc : Contains all system level configuration files Like /etc/passwd, User info /
etc/resolv.conf Preferred DNS /etc/dhcpd.conf
/var : Persistent Variable data. Contains data that frequently changes while the
system is operational. Contains files that change in size, like log files (/var/log/messages)
and databases (/var/lib/mysql).
/mnt : This directory is used to mount a file system temporarily. Empty by default
/media : Used by the system to automatically mount removable media, such as CD,
DVD, USB, and Zip drives. it contains all of the removable media like CD-ROM, pen drive
/lib : It contains library files which are used by OS. It is similar to dll files of
windows. Library files in Linux are SO (shared object) files
/proc : It contain process files. Its contents are not permanent, they keep
changing. It is also called as Virtual Directory. It contain useful information used by OS
like RAM/SWAP/CPU
/opt : This file system holds additional software installed on the system. A sub-
directory is created for each installed software. It is optional directory for usr. It contains
third party softwares.
Linux Basic Commands
env : Displays all the environment variables for the user
which ls : ls is in a directory called bin (/usr/bin/ls)
pwd : Print working directory
history : Shows the history
~user : Specified Users home directory
whoami : Shows as what user we are working now
uname : Prints the system information
man uname : Tell you all commands
uname -a : Print all information
sudo su : switch to root user
ls : list files and directories from current location
ls -a : list all
ls path : list from mentioned path (ex: ls /etc/ or /etc/*)
touch : create a empty file with given name
cd : change directory
cd .. : goes one step back from current path
Cd path. : takes its to the specific path.
Action File Directories
Create touch FILE mkdir NAME
Copy cp FILE TARGET cp –R DIR TARGET
Move mv FILE TARGET mv DIR TARGET
Move / Rename mv FILE TARGET mv DIR TARGET
Delete rm FILE rmdir DIR
rm –r DIR
rm –rf DIR
rm test/* everything inside the test directory
rm -r test recursive
WHAT WILL YOU LEARN TODAY..??
tar czvf file.tar file1.txt file2.txt (create zip file / verbose file)
gzip file.tar.gz : To compress the tar file
tar ztf file.tar.gz : To view the files from a tar file
tar xzvf file.tar.gz : To unzip tar file
-c: Create a new archive
-z: Compress the archive using gzip
-v: Verbose mode, showing progress in the terminal
-f: Specifies the name of the archive file
WHAT WILL YOU LEARN TODAY..??
- regular file
d Directory
l link
p named pipe
s socket
c character device (/dev)
b block device (/dev)
chmod : To modify permissions of a file
chown : To change the ownership
chgrp : To change the group
r --> Read
w --> Write
x --> Execute
• User Management
• Create User and Managing groups
In Linux every process runs as a user.
username: The user's login name. This must be unique for each user.
x: Placeholder for the password. Actual password information is stored in /etc/
shadow for security reasons.
UID: User ID. A unique number assigned to each user.
GID: Group ID. The primary group ID associated with the user.
comment: A field for additional information about the user. Often used for the
user's full name or contact details.
home_directory: The path to the user's home directory.
shell: The path to the user's default shell (e.g., /bin/bash).
/etc/shadow: This file contains Password information
chage -l Username
If you don't want to login any user to login to system, but want to user for
accessing any service, we can set shell to "nologin"
• Managing Process
In Linux OS Process Can be started by following services
--> systemd
--> Linux kernel
--> User commands
kill PID
WHAT WILL YOU LEARN TODAY..??
• Package Management
• Rpm vs yum
• How to add repository
A package format is a type of archive containing computer programs and
additional metadata needed by package managers.
when we run YUM, it verifies in "Local Storage“ and then Global Repos.
We can get repo list by running “yum repolist” command
Apache installation:
yum search httpd
yum info httpd
yum install httpd
Nginx install :
yum info nginx
amazon-linux-extras list
amazon-linux-extras install nginx1
yum history
yum history ID
yum history undo ID
Yum history rollback ID
yum history info ID
yum info package_name
yum search keyword
sudo yum update
Yum install/remove package name
/var/log/yum.log
WHAT WILL YOU LEARN TODAY..??
• Setup hostname
• Basic Network commands
• IP Address information
Pipes : output of a command can be delivered as a input to another command
>> append
Use the Ec2 Instance Meta-data to know the Public-ip and Private-ip of our
running ec2- instance.
Metadata URL: http://169.254.169.254/latest/meta-data/