-
Kernel is the core of an OS and all hardware issues are related to it.
-
Every OS either uses Voice/Text(CLI{Command Line Interface})/GUI all runs some code to do some specific task
-
gedit stands for graphical editor
-
Only a root user is always validated for his action such as delete before completing the task because he has authority to edit any work by any user.
-
All configuring files of OS are stored in etc folder(extra configuration)
-
sh (its a shell) - > developed in 1993 bash(default shell) - > developed in 2000
-
By default redhat shows 1000 history commands
-
History of different terminals is merged as soon as they are closed
-
shell features can be changed or altered permanently by editing the .bashrc file
-
Various Installers are ~ : Microsoft(MSI) ; Redhat(YUM{RHEL<8} / DNF{RHEL 8}) ; Python(pip) ; Go(fmt) ; Ruby(gem)
-
gpgcheck=0 it means not to ask for a license to complete task
-
Python can be used by -
* Interpreter - bash * IDE * File
-
Deadcode Elimination - > segment of code removed from a code that is not being used
-
#! it is called she bang or hash bang
-
while writing python code first line should be #!/usr/bin/python3
-
Best python documentation at docs.python.org
-
when we run python file, its extension does not matter as long as python is written in front.
- $ uname #name of the kernel used in OS
- $ uname -r # version of the currently used kernel
- $ strace date # S stand for system, it shows the background functioning of command (system call)
- $ shell-name # it changes the shell currently being used, and to close just type exit
- $ cat # it is file viewer
- $ uptime # Details about time since when last logined
- $ !history-number # history-number represents the sequence number of command in history and it runs the command again
- $ !starting-text-of-command(bottom-up approach) #same as above
- $ echo variable-name # if variable is not existing , it gives blank without error
- $ echo $ SHELL # predefined variable to show shell name
- $ echo $ USER # predefined variable to show logged in user
- $ echo $ LANG # shows default system language
- $ echo $ HISTSIZE # no of history commands that can be saved
- $ echo $ HISTFILE # storage location of history file
- $ PSI="Pykid : -- > " # inside " " anything can be written and it will be seen as written in terminal left side
- $ env # shows all primitive/predefined commands
- $ alias variable-name='command' # used to create alias / alternative of any command
- $ source path-of-file # it merges any new changes made outside of terminal
- $ tput bold # change text inside Terminal to bold
- $ tput setab 3 # changes background color of terminal
- $ script -t 2>script-name.txt # stores all actions performed in a script file
- $ scriptreplay script-name # replays all commands made on terminal
- $ which and $ whereis # shows tthe stored path for any software or file
-
Actual task/work is performed over hardware of any system.
-
System Call - > communication of command line(Terminal) with the hardware.
-
[App/Software] - > [SHELL](converts human to machine language and vice versa) - > [kernel](brain of OS,tells how to do) - > [Hardware]
-
Shell is like nerve cells for transmitting information where as Kernel is the brain to process and Hardware is body part to perform the instruction. [Command] < -- > [SHELL] - > [Hard Disk] (result send to SHELL)
^ | ^ (Not Found)-- (condition) -- (Found) - > [Kernel] - > [Hard Disk]**SYSTEM CALL ARCHITECTURE**
$function-name()
{ command1 command2 firefox www.google.com #it opens google in firefox } run function by calling name
- Save file with .sh extension
- always initiate a file by " #!/bin/bash "
- use ./file-name to run any file
- Commands ~ :
- read variable-name #read used to take input and store in variable
- echo "string"/$ variable-name # used to print something on terminal
- $ (( command )) or c = $(expr $a + $b) and use * for multiplication
- if [ condition ] followed then and by fi
- Operators ~ : * -eq - > equal * -ne - > not equal * -lt - > less then * -le - > less then equal to
import time time.sleep(No of seconds) #apply code at part where you want to bring delay
- run any command
- run echo $? if output is 0 (command is correct) else not
- Find the date and time of a command from history list as to when it was used { set a variable HISTTIMEFORMAT = "%d/%m/%y %T ", save in .bashrc for permanent }
- Change/Update history manually at path(/home/adhoc/.bash_history) and show in terminal without logout/reboot { update history and just close the terminal, on reopening terminal changed history will be seen }
- What does 2> mean? { 2> inserts commands output in a file only if the command entered in incorrect else it displays the output and saves nothing in file }
- Study/Read about Vulture and Firefly
- Read/Explore OSI Model 6 { https://en.m.wikipedia.org/wiki/Presentation_layer }
- Install VLC player on windows using Python { use pywinauto module, run the code through cmd as administrator }
- Find various use-cases or tuple
{
- Tuples are used to group together related data, such as a person’s name, their age, and their gender.
- immutable objects can allow substantial optimization
- Tuples can potentially be used as keys
- Tuples can be used to store longitude and latitude coordinates }