0% found this document useful (0 votes)
54 views8 pages

Linux Viva

The document outlines the functions and features of operating systems, particularly focusing on Linux as an open-source OS developed by Linus Torvalds. It details the basic components, file permissions, user types, and common commands used in Linux, along with its history and challenges. Additionally, it explains concepts like redirection and provides examples of commands for file management, process management, and system information.

Uploaded by

alfiyaashraf1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views8 pages

Linux Viva

The document outlines the functions and features of operating systems, particularly focusing on Linux as an open-source OS developed by Linus Torvalds. It details the basic components, file permissions, user types, and common commands used in Linux, along with its history and challenges. Additionally, it explains concepts like redirection and provides examples of commands for file management, process management, and system information.

Uploaded by

alfiyaashraf1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Operating System - interface between hardware and user

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

Linux - open-source operating system developed by Linus Torvalds in 1991

Richard Stallman is considered the father of open-source software

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

BASIC COMPONENTS OF LINUX:


1. Kernel
2. Shell
3. GUI
4. Application programs
5. System Utilities

FILE PERMISSIONS IN LINUX:


1. Read: Users open and read files with this permission.
2. Write: Users can open and modify the files.
3. Execute: Users can run the file.

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

COMMONLY USED AND BASIC LINUX COMMANDS:


File and Directory Management
- ls – List files and directories.
- Example: `ls -l` (detailed view).
- cd – Change directory.
- Example: `cd /home`.
- pwd – Print current working directory.
- mkdir – Create a new directory.
- Example: `mkdir my_folder`.
- rmdir – Remove an empty directory.
- rm – Remove files or directories.
- Example: `rm -r my_folder` (recursive deletion).
- cp – Copy files or directories.
- Example: `cp file1 file2`.
- mv – Move or rename files.
- Example: `mv file1 newfile`.

File Viewing and Editing


- cat – Display file contents.
- less – View file contents one screen at a time.
- nano / vim – Edit text files directly in the terminal.
- touch – Create an empty file.

File Permissions and Ownership


- chmod – Change file permissions.
- Example: `chmod 755 script.sh`.
- chown – Change file ownership.
- Example: `chown user:group file`.

Disk and Space Management


- df – Display disk space usage.
- Example: `df -h` (human-readable format).
- du – Show file and directory sizes.
- Example: `du -sh folder_name`.

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.

Search and Filters


- find – Search for files.
- Example: `find /home -name "*.txt"`.
- grep – Search text patterns within files.
- Example: `grep "error" log.txt`.
- wc – Count words, lines, or characters in a file.

Archiving and Compression


- tar – Archive files.
- Example: `tar -czf archive.tar.gz folder`.
- zip / unzip – Compress and extract `.zip` files.
- gzip / gunzip – Compress and extract `.gz` files.

Package Management (varies by distro)


- apt (Debian/Ubuntu): Install packages.
- Example: `sudo apt install package_name`.
- yum / dnf (RHEL/CentOS/Fedora): Install packages.

Other Essential Commands


- echo – Display a message.
- man – Show the manual for a command.
- Example: `man ls`.
- clear – Clear the terminal screen.
- exit – Log out or close the terminal.

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.

• Append (>>): The output is appended to the file without overwriting.


echo "Appending this line." >> output.txt
o Adds the text Appending this line. to output.txt.

2. Input Redirection (<)


Usage: Provide input to a command from a file instead of the keyboard.

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.

more: Forward navigation and limited backward navigation


less: Both forward and backward navigation and also has search options

You might also like