Skip to main content

Posts

Showing posts from 2018

The Buffer Cache

The Buffer Cache Now we know that the files are stored on the hard drive and the processes can access these files and create new files on the disk. When a process requests for a file the kernel brings the file into the main memory where user process can change, read or access the file. The kernel read the super block to figure out the details about the hard drive and the inode table to find the meta data information of any file. So the kernel reads the inode into the memory whenever any process want to access the data and write it back onto the hard disk when the process is done using the file. The kernel could read and write the file directly from the hard disk and put it in memory and vice versa but the response time and throughput will be very low in this case because of disks sow data transfer speed. To minimize the frequency of disk usage/access the kernel keeps a buffer to store the recently accessed files and/or frequently accessed files. This buffer is called the

How to write shell script

H o w t o w r i t e s h e l l s c r i p t F o l l o w i n g s t e p s a r e r e q u i r e d t o w r i t e s h el l s c r i p t : ( 1 ) U s e a n y e d i t o r l i k e v i o r m ce d i t t o w r i t e s h e l l s c r i p t . ( 2 )   A f te r   w r it i n g   s h el l   s c r i p t   s e t   e x e c u t e   p e r m i s s i o n   f o r   y o u r   s c r i p t   a s   f o ll o w s s y n t a x : c h m o d p e r m i ss i o n y o u r - s c r i pt - n a m e E x a m p l e s : $ c h m o d +x y ou r- s c r i p t - n a m e $ c h m o d 75 5 y o u r - s c r i p t - n a m e N o t e : T h i s w i l l s e t r e a d w r i t e e x e c u t e ( 7 ) p e r m i ss i o n f o r o w n e r , f o r g r o u p a n d o t h e r p e r m i ss i o n i s r ea d a n d e x e c u t e o n l y ( 5 ) . l s - l c o mm a n d e a r l i e r p r e s e n t e d a l o n g o f l i s ti n g f il e w it h a l i n e li k e t h e f o l l o