SED Rules in UNIX

Posted by: Shailesh Posted on: March 12, 2012 Comments: 0

FILE SPACING: # double space a file sed G # double space a file which already has blank lines in it. Output file # should contain no more than one blank line between lines of text. sed ‘/^$/d;G’ # triple space a file sed ‘G;G’ # undo double-spacing (assumes even-numbered lines are always blank) sed ‘n;d’ # insert a blank line above every line which matches “regex” sed ‘/regex/{x;p;x;}’ #…

How to configure LVM in Linux

Posted by: Shailesh Posted on: February 22, 2012 Comments: 0

What is an LVM ? LVM stands for Logical Disk Manager which is the fundamental way to manage UNIX/Linux storage systems in a scalable manner. An LVM abstracts disk devices into pools of storage space called Volume Groups. These volume groups are in turn subdivided into virtual disks called Logical Volumes. The logical volumes may be used just like regular disks with filesystem created on them and mounted in the…

Disk Partition On Linux

Posted by: Shailesh Posted on: February 20, 2012 Comments: 0

fdisk is started by typing (as root) fdisk device at the command prompt. device might be something like /dev/hda or /dev/sda . The basic fdisk commands are: p= print the partition table n= create a new partition d= delete a partition q= quit without saving changes w= write the new partition table and exit I start fdisk from the shell prompt: # fdisk /dev/hdb which indicates that I am using…