What Is Unix OS
What Is Unix OS
2) what is process ? what are the types of process ? how to run a process, how to
kill a process
The running instance of a program is known as process a program/command when executed,
a special instance is provided by the system to the process there are two types of process i)
foreground process ii) background process
i) foreground process:- Every process when started runs in foreground by default, receives
input from the keyboard, and sends output to the screen. When issuing pwd command $ ls
pwd
O/P:- $ /home/geeksforgeeks/root
Background Process: It runs in the background without keyboard input and waits till
keyboard input is required. Thus, other processes can be done in parallel with the process
running in the background since they do not have to wait for the previous process to be
completed.
Adding & along with the command starts it as a background process
$ pwd &
Since pwd does not want any input from the keyboard, it goes to the stop state until moved to
the foreground and given any data input. Thus, on pressing Enter:
Output:
[1] + Done pwd
$
How to run a process:-
To run a process :- vi helloworld.c, gcc helloworld.c, ./a.out
How to kill a process:-
To kill a process:- kill -9 pid
3) What is user ? types of user ? how to create a user and how to delete a user?
And what is the cmd to granting a user
Ans:- In UNIX, a user is an entity that can log into the system and execute commands. Each
user is assigned a unique user ID (UID) and associated with a home directory, a default
shell, and other permissions to access system resources like files and directories.
Users are classified into different types, each with varying levels of access to system
resources.
Superuser (Root)
->The root user (UID 0) has unrestricted access to the system.->Can perform
administrative tasks such as installing software, modifying system files, changing user
permissions, and accessing all files and directories.The root user is often referred to as the
superuser.
Regular User
->Regular users have limited access to system resources.
->They can only access files and directories they own or that have appropriate permissions.
->Each regular user has their own home directory (/home/username).
System Users (Service Accounts)
->These users are created for running specific services like databases, web servers, and
system processes.->They often don’t have login privileges and are used by the system to run
background processes.
Create a user: - useradd username , passwd username
Delete a user: - userdel username
Granting a user:- usermod -aG sudo username
->A file system is a set of files, directories, and other structures. File systems maintain
information and identify where a file or directory's data is located on the disk.