2-Day Linux Training

Mohammed Abdul Basith
3 min readJan 25, 2022

Day1: —

1.) Get to learn that there is always requirement to manage the system like processes, memory allocation and RAM, cpu time, storage allocation to the process running in system
2) when normally a process run, it takes default amount of Resources, if there are many processes running and one process is taking too much resources then the other process will suffer with lack of resources, and they may hang up, which could result in system collapse
3) that’s why it’s required to manage the system resources.
4) We can bind the custom resources to any process we want.
5) In every session when login done user can do infinite number of process defaultly from one login session, one can restrict the number of process or task for one login session,
6.) There is unit files in the system which is responsible for logins resources, unit files can be changed and also change the maximum ram provided and task per login,
tlog-rec program to actually record your terminal
7.) tmux : program : allows multiple terminal session to be accessed simultaneously in a single window .
8.) strace : program : to ses how any command executing, like how system calls are happening.
9.) ncat/netcat/nc program to make chat a program from one session to another session, TCP protocol only listen by one session

Day2 —

1.) Dev code converted to machine code / binary code and runtime process created
Kernel allocate the resources
2.) Dmidecode -type memory cmd to check actual size of physical memory and other info
3.) /proc is the folder where all info about the process is saved with their name as pid
4.) To see the process,
$ cd /proc
$ cd 1602 // pid
In pid 1602 there are many files likes Status, stack, syscall , oom_scale
4.) In RAM there is three main parts, code section, stack memory, heap memory, a
Stack memory is static, heap memory allocates dynamically, code section read the code and according to the code space provided
5.) sometimes while allocation of memory which is dynamic, some times forget to free the memory so chances of memory leakage,
6.) $ yum install valgrind , valgrind can analyse for memory leakage
7.)$ valgrind — leak-check=full — tool=memcheck code_file
cgroup create unit file, manage by systemctl , which is manage by systemd , systemd have access to unit file
8.) When program install , it install with unit file which have all things inside , like how much resources should be given
9.) Systemctl daemon-relaod , after edited the unit files to load on system
10.) lscpu, system-delta, dmidecode, ps and many other command get to know
11.) Cpu scheduling , sysstate, mpstate cmd, fdisk, lsblk, textdisk cmd for file recovery.

It was an amazing experience to have such session by Vimal Sir.

Thank You for reading…

--

--