DevOps Tools and Techniques: A Comprehensive Guide to Networking, Linux, and More

Anurag SharmaAnurag Sharma
2 min read

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

On This Link

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

  1. SuperUser (Root User)

  2. User Account (myname)

  3. Service User

    relevant for Linux Server Distro

Windows has centrally managed permissions.

-Groups & Permissions

Permissions of 2 types ===>User and Group

  1. Adding a User

    sudo adduser username

    sudo passwd username

    su - Sharma (for switch to user)

  2. Adding a group

    sudo groupadd groupL

  3. 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

0No Permission
1Execute
2Write
3Execte_Write
4Read
5Read+Execute
6Read+Write
7Read+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 .

0
Subscribe to my newsletter

Read articles from Anurag Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anurag Sharma
Anurag Sharma