DevOps Tools and Techniques: A Comprehensive Guide to Networking, Linux, and More
Into OS
Memory -RAM=Working Memory
UNIX system - Tree file system
(C.P.U+Memory+Storage)<-------Kernel------->Device Driver------->I/O
Linux Kernel in Linux and Android.
Darwin is in MAC and IOS .
CLI=Command Line Interface -----> Server
Linux File System Structure
/bin = binaries
/sbin = System binaries
/lib = Library
/usr = filesof user includes bin,sbin,lib etc.
/usr/local = Third Apps
/etc = Main Config Location
/dev = devices I/O
/var = System logs,cache....
/temp = temp
/media-/mount = USB...
dotfiles = Hidden
Some Linux Commands
Vim Editor
There are 2 modes:- Command Mode ---------- Editor Mode
:wq = write and quit
:q! = quit without saving
dd = delete lines in command
d10d delete 10 lines
/bye = search bye in file
:%s/bye/bye-bye = replace wala
Users & Permissions
SuperUser (Root User)
User Account (myname)
Service User
relevant for Linux Server Distro
Windows has centrally managed permissions.
-Groups & Permissions
Permissions of 2 types ===>User and Group
Adding a User
sudo adduser username
sudo passwd username
su - Sharma (for switch to user)
Adding a group
sudo groupadd groupL
deluser and userdel
Adding User into Group
sudo usermod -g groupL Sharma
Multiple Secondary group
sudo usermod -G admin,dev,test username
use -aG for adding new groups
ls -la will list down the permissons of users and groups .
drwx-
directory read write execute no-perm
sudo chmod u+x temp2.txt (giving execute perm to user)
Bulk Permissions
sudo chmod g=rwx script.sh
Number Permissions
0 | No Permission |
1 | Execute |
2 | Write |
3 | Execte_Write |
4 | Read |
5 | Read+Execute |
6 | Read+Write |
7 | Read+Write+Execute |
Pipes and Redirects
Run this first = cat /var/log/lastlog
Then this = cat /var/log/lastlog | less
grep is used to filter out . like
history | grep sudo ( will only shows commands with sudo perm .. )
for Redirects -----> ls /usr/bin | grep python > python.yaml
this will get also python wali file and copy that to python.yaml .
Subscribe to my newsletter
Read articles from Anurag Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by