Sie sind auf Seite 1von 5

Linux File System:

There are Three Basic types of Files In Linux

Ordinary Files − An ordinary file is a file on the system that contains data, text, or program
instructions. In this tutorial, you look at working with ordinary files.

Directories − Directories store both special and ordinary files. For users familiar with Windows or
Mac OS, Unix directories are equivalent to folders.

Special Files − Some special files provide access to hardware such as hard drives, CD-ROM drives,
modems, and Ethernet adapters. Other special files are similar to aliases or shortcuts and enable you
to access a single file using different names.

Linux Command

1) Ls -> show list of file and folder in linux

EXAMPLE

$ls

bin hosts lib res.03


ch07 hw1 pub test_results
ch07.bak hw2 res.01 users
docs hw3 res.02 work

$ls -l
-rw-rw-r--. 1 vivekaadiv vivekaadiv 8 Mar 20 16:44 f.txt

 First Column − Represents the file type and the permission given on
the file. Below is the description of all type of files.

 Second Column − Represents the number of memory blocks taken by


the file or directory.

 Third Column − Represents the owner of the file. This is the Unix user
who created this file.

 Fourth Column − Represents the group of the owner. Every Unix user
will have an associated group.

 Fifth Column − Represents the file size in bytes.

 Sixth Column − Represents the date and the time when this file was
created or modified for the last time.

 Seventh Column − Represents the file or the directory name.


2) Vi :- It is an editor to create a file in linux.

a) Shift + ZZ -> it is used to save and quit file.

3) CP -> copy content of one file to another

$ cp source_file destination_file

EXAMPLE

[vivekaadiv@server-1 ~]$cp f.txt f22.tx


[vivekaadiv@server-1 ~]$ls -l
total 8
-rw-rw-r--. 1 vivekaadiv vivekaadiv 8 Mar 20 16:55 f22.txt
-rw-rw-r--. 1 vivekaadiv vivekaadiv 8 Mar 20 16:44 f.txt

4)

5) Cat : It is used to Display content of File.


6) Wc : It is used to count no of lines , word , size and file name.
7) [vivekaadiv@server-1 ~]$wc f.txt
8) 2 2 8 f.txt

Renaming Files
To change the name of a file, use the mv command. Following is the basic
syntax −
$ mv old_file new_file

The following program will rename the existing file filename to newfile.
$ mv filename newfile
$

The mv command will move the existing file completely into the new file. In
this case, you will find only newfile in your current directory.

Deleting Files
To delete an existing file, use the rm command. Following is the basic syntax

$ rm filename
Linux is one of popular version of UNIX operating System. It is open source
as its source code is freely available. It is free to use. Linux was designed
considering UNIX compatibility. Its functionality list is quite similar to that
of UNIX.

Components of Linux System


Linux Operating System has primarily three components

 Kernel − Kernel is the core part of Linux. It is responsible for all major
activities of this operating system. It consists of various modules and it
interacts directly with the underlying hardware. Kernel provides the required
abstraction to hide low level hardware details to system or application
programs.

 System Library − System libraries are special functions or programs using


which application programs or system utilities accesses Kernel's features.
These libraries implement most of the functionalities of the operating system
and do not requires kernel module's code access rights.

 System Utility − System Utility programs are responsible to do specialized,


individual level tasks.

Kernel Mode vs User Mode


Kernel component code executes in a special privileged mode
called kernel mode with full access to all resources of the computer. This
code represents a single process, executes in single address space and do
not require any context switch and hence is very efficient and fast. Kernel
runs each processes and provides system services to processes, provides
protected access to hardware to processes.

Support code which is not required to run in kernel mode is in System


Library. User programs and other system programs works in User
Mode which has no access to system hardware and kernel code. User
programs/ utilities use System libraries to access Kernel functions to get
system's low level tasks.

Basic Features
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 multiple


applications can run at same time.

 Hierarchical File System − Linux provides a standard file structure in which


system files/ user files are arranged.

 Shell − Linux provides a special interpreter program which can be used to


execute 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.

Architecture
The following illustration shows the architecture of a Linux system −
The architect

Das könnte Ihnen auch gefallen