Linux Viva
Linux Viva
FUNCTIONS OF OS:
1. Command interpretation
2. Process management
3. Memory management
4. Input/Output management
5. Security
CLOSED MODEL
Not accessible to the public.
e.g., Windows, Unix
OPEN MODEL
Freely available for anyone to view, use, modify, and distribute.
e.g., Linux
FEATURES OF LINUX:
1. Multi-tasking
2. Multi programming
3. Multi user system
4. Virtual memory
5. Licensing
CHALLENGES OF LINUX:
1. Hardware compatibility
2. Difficult to learn
3. Driver and firmware-related issues
HISTORY OF LINUX:
1969: UNIX was developed by Ken Thompson, Dennis Ritchie, and others using assembly
language.
1973: Rewritten using C.
1974: Licensed to few vendors like San, IBM, Hewlett-Packard
1983: Richard Stallman started the GNU Project (under Free Software Foundation - FSF) to
create a free UNIX-like operating system.
1991: Linus Torvalds began developing Linux, a free UNIX-like operating system kernel.
1992: Linux kernel was combined with GNU tools called GNU Linux or Linux.
LINUX KERNEL:
Low-level software system
Provides a user interface
Released under GPL (General Public License)
GUI (graphical user interface):
Visual environment that allows users to interact with the operating system using a mouse
and keyboard.
TYPES OF SHELL:
1. Bourne shell (sh)
2. C shell (csh)
3. KornShell (ksh)
4. Restricted shell
5. Bourne Again Shell (bash)
6. TENEX C Shell (tcsh)
7. A shell
8. Z Shell (zsh)
TYPES OF USERS:
1. Root User (Super user):
Unrestricted access to the system
Can perform all administrative tasks
Has access to all commands and files, regardless of permissions
2. Normal User:
Limited privileges
Can access and modify files they own or have been granted permissions to
Restricted from performing administrative tasks
OWNERSHIP ATTRIBUTES:
1. File Owner (User)
The user who created the file or directory by default.
Has specific permissions to read, write, or execute the file.
Ownership can be changed using the chown command
e.g., chown newowner file
2. Group Owner
A group associated with the file or directory.
Members of this group inherit specific permissions (read, write, execute) for the file.
The group ownership can be changed using the chown command with :
e.g., chown :newgroup file
Example:ls -l
-rw-r--r-- 1 alice developers 1024 Nov 20 example.txt
alice: File owner (user).
developers: Group owner.
3. Other users
vi EDITOR:
Powerful and widely used text editor in UNIX and Linux operating system
Allows us to create, edit and manage text files
bc
Stands for Basic Calculator
Used for performing precise arithmetic calculations
Process Management
- ps – Display running processes.
- top / htop – Show system resource usage and processes interactively.
- kill – Terminate a process by its ID.
- Example: `kill 1234`.
- jobs – List background jobs.
- bg / fg – Manage jobs in the background or foreground.
Networking
- ping – Test connectivity to a host.
- Example: `ping google.com`.
- curl / wget – Download files from a URL.
- ifconfig / ip – Display network configuration.
System Information
- uname – Display system information.
- Example: `uname -a`.
- whoami – Show the current user.
- uptime – Show how long the system has been running.
- history – View the command history.
REDIRECTION
1. Output Redirection (>, >>)
Usage: Save or append the output of a command to a file.
• Overwrite (>): The output is written to the file, replacing its existing content.
echo "Hello, World!" > output.txt
o Creates a file output.txt with the text Hello, World!.
o Overwrites the file if it already exists.
wc -l < input.txt
o Counts the lines in input.txt and outputs the result.
o wc normally takes input from the keyboard; the < operator provides it with
the contents of input.txt.