Linux Operating System – Contents

It starts from my needs to have both version 2 and 3 Python run in my machine, as Python2 is set to be retired by the community in 2020, however, lots of the work needs to be maitained at Python2 to ensure a smooth transition. That’s why I am looking for a solution, which further leads me to dig into operating system, in particular, Linux.

Professor Arif Butt’s series of video is quite thorough even with a bit of middle east accent. He organizes his teaching into the following modules.

Linux Environment
Basic Shell Commands
VIM Editor
Bash Shell Further
Process Management
Redirection
IPC
Signal Handling
Process Scheduling
Proc Directory
Task Scheduling
Software Installation
User Managment
Disk Geometry
Disk Partitioning
Disk Formatting
Sysmtem Mounting
system Architecture
Hard and Soft Links
File Permissions
Special File Permissions
Access Control Lists
Device Files
Terminal Attributes
Time Managment
Managing Services Using Systemd
Linux Log Files
Booting Processs

From his lecture, we first get to learn the infrastructure of computer from top down, OS on VM, Virtual Machine, and VM on top of Hypervisor (VM monitor), Hypervisor on top of OS on top of physical hardware.


There are two types of hypervisors – Type I and Type II hypervisors. Type II contains: Oracle Virtual Box, VM Ware, Solaris Zones, MS Visual PC, and QEMU. Since the creation by Linus. There are multiple Linux Distributions too: RedHat, Fedora, Ubuntu is most popular, CentoOS, and Debian also pervasive.

Internal command such as cd exit type help, they are part of the shell program itself. while external command is a command hwose code reside in a fiel on disk. e.g., clear, ls, passwd, man.

Not like windows file system, of which we are familiar with C drive, I drive etc, in Linux, everything is stored in root directory, enterrable by cd /, and bin bin directory, containing all user related commands. There are

  1. Binary directories such as sbin diectory, lib64, opt directory for optional software, mostly are empty;
  2. Configuration directories include boot directory;
  3. Data directories are home, root, srv, media, mnt and temp directory. media directory for media software such as CD etc.
  4. In memory directories such as proc (contains names are PID of process), dev, sys, they are not reside in memory.
  5. System Resources directory, /usr/
  6. Variable Data directory /var/ contains file with unpredictable size

Adding on above in regard to real work, when I need to set up sql connection to two databases, one is set via pyodbc.connect(“DRIVER={SQL Server};SERVER=revere-livedata-reporting-sql-primary.prod.factset.com; DATABASE=revere-livedata-reporting”), while the other is by
connStr = (r’DSN=sdfdemoprod;’);
cconn = pyodbc.connect(connStr); which is executed by run windows registry sdfdemo_dsn.reg script:, note the driver setting is not usual SQL Server, but a dll file.

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sdfdemoprod]
“Driver”=”C:\\WINDOWS\\system32\\msodbcsql13.dll”
“Description”=”SDFDemo Production”
“Server”=”sdfdemoprod-sql.prod.factset.com”
“Database”=”sdfdemo”
“Encrypt”=”Yes”
“TrustServerCertificate”=”Yes”
“ApplicationIntent”=”READONLY”
“MultiSubnetFailover”=”Yes”
“ClientCertificate”=””
“KeystoreAuthentication”=””
“KeystorePrincipalId”=””
“KeystoreSecret”=””
“KeystoreLocation”=””
“Authentication”=”ActiveDirectoryIntegrated”

Starting from each clip all over again on Jan 06th, 2020.

1969 operating system in AT&T Bell lab, hippies in Berkeley California, there are two versions of Unix, one is the official the other is BDS UNIX, 1990, Finnish Linus Torvard wrote a brand new POISX compliant kernel, we have Linux running on 97% of servers, 80% smartphones in the world.
Linux Distributions include many, top one is RedHat, then Fedora, Ubuntu is the most popular one, CentOS and Debian are also well known.

Binary directory contains common command such as ls, cd.
sbin directory contains commands administrator usually use, lib64 directory contains shared objects. opt directory has optional software commands, mostly empty. configuration directory contains configuration commands such as boot. etc directory means editable configuration commands, data directory include home directory. root directory is the only user in our system have user in. home directory contains.., media directory serves as a mount for removable devices such as CDs, make it part of local file system.

in memory directories not actual exist on hard disk, these are dev, proc and sys. in dev, there are files related to the hardware. proc directory includes PID of processes running on the system. sys contains information about hardware . system Resources directory include /usr/ unix system resources, contains bin, include slc, local share etc. Variable Data directory /var/ contains all those file with unpredictable size such as log file.

To get help, wade through linux, master these commands;

man clear
whatis clear
whereis clear

man man
man -k password (vague searching with the string of password)
man 5 passwd (find the chapter 5 of passwd)

whoami
pwd
ls
man ls
ls -1 display file name in single column
ls -a display hidden files also
ls – l long format -rwxrwxr -x l arif arif 8728(bytes) timestampe sep 21 18:18 a.out
which ls
/bin/ls
which passwd
/usr/bin/passwd

rmdir d1 d2
delete directory, note tehy must be empty
touch f1 f2 f3
create files, change timestamp
cat f1.txt
see the contents of the file
cat f2.txt
more f2.txt (to veiw it page by page)
lessf2.txt
head f2.txt
head -5 f2.txt (first 5 lines)
cp f2.txt ../kakamanna.txt (copy file)
mv kakamanna.txt ../
cp -r (copy directory)
cp a b c d e f g (copy all previous ones to g)
rm f3
rm -r d1 (remove directory use -r)
type alias
alisa is a shell builtin
help alias (help is not man, to get built in commands)
alias ll = ‘ls -alF’
alias ‘pleasecleanscree = alias’ (to create alias)
cal (calendar)
cal 2000
cal 12 1998
date
date -s “Tue Oct 15 00;00;;00 PKT 2000”
shutdown now
shutdown +5 (shut down in 5 min)
reboot
halt
poweroff
use shutdown preferable

man wc
wc (waiting for anything from keyboard)
control D done with input
give 4 lines, 17 words, 88 letters
wc /etc/passwd
sort freinds.txt
grep general regular processor
man grep
grep arif /etc/passwd
(display only those lines, case senstive)
uniq display duplicative lines
uniq uniq.txt
man cut
cmp (compare)
comm ()
diff ()
man find
find ~ -name f1.txt
(find the pattern that name)
find -mtime
find -ctime
tar
gzip file1 file2

vim editors
man nano
man emac
man vim
sudo apt-get install emacs
vim frends.txt (to open)
:q enter to quit
vim + abc.txt (end of the file)
three main modes of VIM: command, insert and last line mode

There are two types of shell commands

process management or compilation process, gcc-E, -S, -C, gcc hello.o,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.