0% found this document useful (0 votes)
2 views4 pages

Operaing System

Uploaded by

dorukaysor
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)
2 views4 pages

Operaing System

Uploaded by

dorukaysor
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/ 4

Operaing System(os):

It is a type of system software that acts as an interface between the users of a computer and the computer
hardware. It acts as the resource manager that use the computer resources like CPU,memory,files and I/O
devices in an efficient manner.

An operating system are of two types:

1. Command-line based OS (example MSDOS,UNIX)


2. Graphical User Interface (GUI)based OS (example WINDOWS,LINUX)

LINUX operating system:

Linux operating system is the most popular open-source operating system around the world. It is termed open-
source because the source code of the operating system is available to every one.

UNIX operating system:

UNIX is a command-line based operating system, which means that users interact with it using text
commands.It is a family of multitasking,multiuser computer operating system.

Structure of UNIX OS

The UNIX OS is divided into 4 layersc that help the interaction between the hardware and the user.
These layers are: hardware layer(OS),Kernel layer,Shell layer and Application layer(User)

UNIX Shell:
A shell layer acts as an intermediary between the user and the kernel layer of the operating system.
A kernel is loaded into the memory on system startup and manage the overall function of system
until the system is shutdown.User can interact with the computer system by typing commands in Shell.

In Unix operating system the different command line shells are

sh – Bourne shell
bash – Bourne Again shell
csh – C shell
By default, the dollar $ symbol is used as a prompt in Bourne shell.and bash.(Bourne Again Shell)

About UNIX command

- Commands are typed at a prompt.


- Commands are case sensitive and are usually lower case,
- There is always a space between the command and the file or directory
- To execute a UNIX command, press ENTER at the end of the command line
- To determine the default shell, type echo $shell

What is directory in UNIX:

A directory in UNIX is a folder that contains the name of files.The UNIX file system is organized in a tree
like structure called a directory tree, where root is at top and leaves are at the bottom. The root directory is
represented by forward slash (/).
List of UNIX commands and their uses

1. pwd- print working directory

pwd command prints the name of the current path of the working directory.

Syntax: $ pwd (press Enter)

2. mkdir : create a new directory

The mkdir command is used to create new directory.

Syntax: $ mkdir directory name (press Enter)

Ex. $ mkdir test (press Enter)


Here test is the directory name

3. rmdir : remove a directory

The rmdir command is used to remove directory if it is empty.

Syntax : $ rmdir directory name (press Enter)

Ex. $ rmdir test (press Enter)


test directory is remove if it is empty

4. cd: change directory

The cd command is used to change the current directory.

Syntax: $ cd drrectory name press Enter


Ex1. $ mkdir test (press Enter)
$ cd test (press Enter)
test/$
here test is the directory

Ex.2. $ mkdir test1 (press Enter)


$ mkdir test2 (press Enter)
$ cd test1 (press Enter)
test1/$ cd test2 (press Enter)
test1/test2/$

here test1 is the root directory and test2 is the sub-directory

Various symbols is used with cd command

Single dot ( . ) : current directory

Double dot ( .. ) : parent directory

Tilde ( ~ ) : home directory


5. rm command

The rm command is used to remove files.

Syntax : $ rm filename (press Enter)


Ex. $ rm file1 (press Enter)
Here file1 is the filename which is to be removed.

6. mv command

The mv command is used to move or Rename files or directories.

Syntax : $ mv sourcefile destinationfile press Enter


Ex. $ mv file1 file2 (press Enter)
Here sourcefile is file1 and destinationfile is file2
After execution file1 is renamed as file2.

7. touch command

The touch command is used to create a new empty file. Multiple files can also be created at once
using the command.

Syntax: $ touch filename (press Enter)

Ex.1. $ touch file1 (press Enter)


Here filename is file1 and which is empty file

Ex.2. $ touch file1 file2 (press Enter)


Here more than one empty file is created named as file1 and file2

8. cat command
The cat ( concatenate ) command is used to create, view and concatnate ( append ) files.

For create files


Syntax: $ cat > filename (press Enter)
For view files
Syntax: $ cat filename (press Enter)

For view multiple files


Syntax: $ cat filename1 filename2 press Enter
Ex. $ cat file1 file2 (press Enter)
After execution contents of file1 and file2 is diplayed at a time

For append files


Syntax : $ cat file1 >> file2 (press Enter) (
Let file1 contain “world” text and file2 contain “hello” text
After execution the result is “helloworld”

For copy contents of one file to another file


Syntax: $ cat sourcefile destination file press Enter
Ex. $ cat file1 > file2 (press Enter)
Here after execution contents of file1 is overwrite in file2

You might also like