Linux - 11th May
Linux - 11th May
• Linux is different from other operating systems for many reasons. Firstly, it is open-
source and multilingual software. Most importantly, the code used for Linux is free for
users to view and edit.
• The Linux system is very stable and is not prone to crashes. The Linux OS runs exactly as
fast as it did when first installed, even after several years. … Unlike Windows, you need
not reboot a Linux server after every update or patch. Due to this, Linux has the highest
number of servers running on the Internet.
• It is a stable, multi-user, multi-tasking system for servers, desktops and laptops.
2
IT Solutions
Basic Features of Linux
Following are some of the important features of Linux Operating System.
Portable − Portability means software can works on different types of hardware in same
way. Linux kernel and application programs supports their installation on any kind of
hardware platform.
Open Source − Linux source code is freely available and it is community based development
project. Multiple teams work in collaboration to enhance the capability of Linux operating
system and it is continuously evolving.
Multi-User − Linux is a multiuser system means multiple users can access system resources
like memory/ ram/ application programs at same time.
Multiprogramming − Linux is a multiprogramming system means multipleEngineering applications can
Services
run at same time.
Hierarchical File System − Linux provides a standard file structure in which
Automatedsystem files/ user
Fare Collection,
Point of Sale & ATM Solutions,
files are arranged. Self Service Terminals,
Shell − Linux provides a special interpreter program which can be used toInternetexecute
of Things.
commands of the operating system. It can be used to do various types of operations, call
application programs. etc.
Security − Linux provides user security using authentication features like password
protection/ controlled access to specific files/ encryption of data.
IT Solutions
Architecture of Linux
The architecture of a Linux System consists of the following layers −
Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).
Kernel − It is the core component of Operating System, interacts directly with hardware,
provides low level services to upper layer components.
Shell − An interface to kernel, hiding complexity of kernel's functions from users. The shell
takes commands from the user and executes kernel's functions.
Utilities − Utility programs that provide the user most of the functionalities of an operating
systems.
Engineering
Services
Engineering
Services
Engineering
Services
Root account
This is also called superuser and would have complete and unfettered control of the system. A
superuser can run any commands without any restriction. This user should be assumed as a
system administrator.
System accounts
System accounts are those needed for the operation of system-specific components for
example mail accounts and the sshd accounts. These accounts are usually needed for some
Engineering
specific function on your system, and any modifications to them could adversely affect the
Services
system.
User accounts Automated Fare Collection,
Point of Sale & ATM Solutions,
User accounts provide interactive access to the system for users and groupsSelfofService
users. General
Terminals,
users are typically assigned to these accounts and usually have limited access to critical
Internet of Things. system
Linux supports a concept of Group Account which logically groups a number of accounts. Every
account would be a part of another group account. A Linux group plays important role in
handling file permissions and process management.
IT Solutions
User administration in Linux (continued)
The common commands for user administration are as follows:
Sr.No. Command Description
1 useradd Adds accounts to the system
2 usermod Modifies account attributes
3 userdel Deletes accounts from the system
4 groupadd Adds groups to the system
5 groupmod Modifies group attributes
6 groupdel Removes groups from the system Engineering
Services
There are four main user administration files − Automated Fare Collection,
•/etc/passwd − Keeps the user account and password information. This file holds
Pointthe
of Sale & ATM Solutions,
majority of information about accounts on the Unix system. Self Service Terminals,
Internet of Things.
•/etc/shadow − Holds the encrypted password of the corresponding account. Not all the
systems support this file.
•/etc/group − This file contains the group information for each account.
•/etc/gshadow − This file contains secure group account information.
IT Solutions
Monitoring System Performance
Linux provides following important commands to measure and fine tune system performance:
Sr.No. Command Description
It helps in execution of a program/process with modified scheduling priority. It launches
1 nice/renice a process with a user-defined scheduling priority. In this, if we give a process a higher
priority, then Kernel will allocate more CPU time to that process.
2 netstat This command is used for monitoring network connections both incoming and
outgoing as well as viewing routing tables, interface statistics, etc.
3 time Helps time a simple command or give resource usage
4 uptime It gives the uptime of the system
This commaind is used to list the currently running processes and their Engineering
PIDs along with
5 ps Services
some other information depends on different options
6 vmstat This command is used to obtain information about memory, system Automatedprocesses, paging,
Fare Collection,
interrupts, block I/O, disk, and CPU scheduling. Point of Sale & ATM Solutions,
Self Service Terminals,
Internet of Things.
7 top This command shows a real-time view of running processes in Linux and displays kernel-
managed tasks. The command also provides a system information summary that shows
resource utilization, including CPU and memory usage.
It allows administrators to view information about users that are currently logged in.
8 w This includes their username, where they are logged in from, and what they are
currently doing.
IT Solutions
File/Directory Permissions and Ownership
File/Directory Ownership and Permissions:
Every file/directory belongs to a specific user or a group of users
Every user/group many have permissions to read, write, &/or execute
If you set read permission for a directory you can create new entries
If you set write permission for a directory you can list (ls) the contents
If you set execute permission for a directory you can cd into the directory
A good starting point for files in your directory is "chmod 644" or "chmod 755" for files you want to
allow yourself to change and others to see (or execute). Engineering
chmod command changes the rwx mode bits of a file or directory Services
• +/-: adds or removes the mode bits Automated Fare Collection,
• o: Sets the permissions for the owner of the file/directory Point of Sale & ATM Solutions,
• g: Sets the permissions for the group that of the owner belongs to Self Service Terminals,
Internet of Things.
• a: Sets the permissions for the all other users
IT Solutions
Text Editors in Linux
There are many text editors available on Linux. The most common editors are:
• nano is a small, simple and friendly editor
• vi/vim is a powerful text editor which can be used to edit all kinds of text
Engineering
Services
Engineering
Services
© Copyright 2020 Datamatics Global Services Limited and its subsidiaries (hereinafter jointly referred as Datamatics). All rights reserved.
Contents in this document are confidential and proprietary to Datamatics. No part of this document should be reproduced, published, transmitted or distributed in any form or by any means, electronic, mechanical, photocopying,
recording or otherwise, nor should be disclosed to third parties without prior written approval from the marketing team at Datamatics.