Basics of OS and Linux
Basics of OS and Linux
Operating System
What is an OS?
Operating Systems is a system software that acts as an interface
between the software and different parts of the computer or the computer
hardware.
It is designed in such a way that it can manage the overall resources and
operations of the computer.
It controls and monitors the execution of all other programs that reside in
the computer.
Some of the most popular operating systems in use today are Microsoft
Windows, Apple mac OS, and Linux.
File System
A file system is a method an operating system uses to store, organise,
and manage files and directories on a storage device.
APFS (Apple File System): A new file system introduced by Apple for
their Macs and iOS devices.
To put it in simple terms, we write our computer programs in a text file and
when we execute this program, it becomes a process which performs all
the tasks mentioned in the program.
The thread takes less time to terminate as compared to the process but
unlike the process, threads do not isolate.
Command - ps
Linux
Debian
packages.
On Ubuntu and all other Debian based distributions, the apt software
repositories are defined in the /etc/apt/sources.list file or in separate
files under the /etc/apt/sources.list.d/
Arch Linux
GNOME
GNOME (GNU Network Object Model Environment) is a graphical user
interface (GUI) and set of computer desktop applications for users of the
Linux operating system.
Linux VS Windows
Linux facilitates the users to have access to the source code of the
operating system and authorises them to make amendments as per their
choices. On the other hand, Windows users don’t have such privileges.
In terms of speed, Linux runs faster than the Windows operating system,
especially on moderately powerful systems, while the Windows operating
system starts becoming slower with time.
In the case of gaming, Windows is on the higher side than Linux, as most
developers intended to create games for Windows only.
Kernel
Commands
L: Everything is treated like a file or a process. Directories are files, files are
files, and externally connected devices (such as Printer, mouse, keyboard)
are also files.
W: Uses FAT and NTFs as file systems,
Linux has two kinds of major partitions called data partitions and swap
partitions. Because of the existence of swap partitions, you never run out
of memory in Linux (like in windows).
Linux doesn’t use the file extension to determine file types. It uses a
header bytes of files and matches them with the set of magic numbers to
determine the file type. The file command is used to determine file type
root user, just like any other user, has elevated privileges but in user
space, that is, it cannot execute privileged commands like kernel which
directly manipulates the hardware.
suis used to switch between users, but this requires root level
permissions.
WSL actually runs a a Linux kernel & OS inside of Windows and translates
Linux system calls to NT system calls. A surprising amount of features work
well. You can even get a Linux distro with a desktop running.
The terminal is a program that opens a graphical window and lets you
interact with the shell.
The shell gives users (or other programs) a way to get "inside" the system to run
programs or manage configurations. The shell defines the boundary between
inside and outside.
ps , kill -9 (signal)
ssh , scp
symlinks
bashrc
The .bashrc file is a script file that’s executed when a user logs in.
The file itself contains a series of configurations for the terminal session.
Shell customisations
Alias
Aliases are different names for the same command. Consider them as
shortcuts to a longer form command.
Bash Scripting
Check attached links
Functions - omniport-frontend
Braces
John Hammond
Vim
Vim is a free and open-source, screen-based text editor program. It is an
improved clone of vi.
Features:
It is command centric. You can perform complex text related task with
few commands
It is highly configurable and uses simple text file to store its configuration
There are many plug-in available for Vim. Its functionality can be
extended in great manner using these plug-in
Word movement (w e b)
Visual (v V Ctrl+v)
Search
/?
/\<word\>
:set ic
:set noic
Delete
dw
dd
5dd
d$
d0
:3,5d
cut (d)
copy (y yy yw)
paster (p)
Tmux
Basics
Tmux is a terminal multiplexer.
You can start a Tmux session and then open multiple windows inside that
session
Each window occupies the entire screen and can be split into rectangular
panes.
Commands
ctrl-b is the default prefix to the tell that this command is for tmux
w list windows
% split horizontally
Bibliography
Desktop Environment
Distros
sudo
Ring diagram
Bash Scripting
Brackets in Bash
Syscall Table
Tmux