Friday, September 11, 2015

Vi & Vim editor shortcut key


: shift +$ = End of the text file
:1 =starting of the text file
:10 = jump on line no. 10 directly
dd = delete a single line
12dd = delete a 12 line at a time
:wq = save a file
X (small x) = delete a single character
Dw = for delete a single word
O = add blank line below the cursor
Shift + O = add blank line above the cursor
Cc =change to line
Cw = used to change a single word
U = undo the chnges
Ctrl+r = redu the changes
Yy = for copy single line
P = for paste
Yw = for copy one word
4yy = 4 lines copy
GGYG = copy whole page or text
/ ” = used to search file ,words & text name
N (capital N) = search to backward
n(small n) = search to forward direction
:set nu = set numbering to doc,file or text to all lines
:set nonu = remove to numbers from doc,file & text
:set hls = for hightling words
:set nohls = for remove hightling words
Shift+Tild sign ^ = use for uppercase character
:set ic = set ignore case highlited
:shift + H (capital H) = move head of the text
:shift +M (capital M ) = middle of the text
:shift+L (capital L)= End of the text
:shift X = to assign passwd
:set key = = to remove passwd
: %s/dhcpd/samba/g = used to replaced the word.
( where , s –substitute & g – for globle change )
: wq! = save file forcefully




Introduction about TAR files


Descriptions :- “ tar ” save many files together into a single tape pr disk archive.


Create a directory & folder & convert into tar,gz…etc
Mkdir big (folder)
Convert “big” folder into tar file.
Tar – cvf big.tar big
Tar – tvf big.tar ( t- stands for view the content of the file)
Tar – xvf big.tar (extract the tar file)
Compression Tools
gzip -v big.tar ( convert into tar.gz format)
gunzip -v big.tar.gz ( convert into tar file)
bzip2 –v big.tar ( convert into tar.bz2)
bunzip2 –v big.tar.bz2 (convert into big.tar)
tar –czvf big.tar.gz big ( use to gzip)
tar –tzvf big.tar.gz
tar –cjvf big.tar.bz2 big (used to bz2)
tar –cvf big.tar big big1 (add multiple files in tar)




Partition TableTopic


Partition table create using “fdisk -cu /dev/sda “ command
Fdisk –cu /dev/sda -----press enter key
Then ….use (m for help )
Press “ n “ for create a new partition
Press “ w” to write a partition table & save & exit
Then.. hit “ partx –a /dev/sda “ command ( to inform the kernel about new partition)
After that, format to a new partition table
Mkfs.ext4 /dev/sda5….
Then…create a mount he re ..
Mkdir /imp
Mount /dev/sda /imp (use for mount command)
Then make permanent entry in /etc/fstab , if mounting file not save in /etc/fstab then..at the time of rebooting system , mounted folder automatically umounted. So always make an entry in “fstab”.
/etc/fstb
/dev/sda5 /imp ext4 defaults 0 0 (entry like that).
Mount –a (to check mount error)
Blkid /dev/sda5 (showing uid)
Yum install gpm* -y (install mouse package)
Swap partition table
Fdisk –cu /dev/sda
n - create a new partition
press enter key & assign a size of swap partitions like,+1G
then , press enter
then.. press “ t” to change a partition code id (swap code = 82)
then press “w” to write a partition table , save & exit
now, inform to kernel by “ partx –a /dev/sda” command.
Now, format a partition table… mkfs.ext4 /dev/sda6… (to convert into swap partition table)
Swapon /dev/sda6 ( to command , see the swap partition active or not )
Swapon -s (to check active partition)
Swapoff /dev/sda6 (to use this command when we don’t have a more than one swap on.)
Now, permanent entry in “ /etc/fstab


Vim /etc/fstab
/dev/sda6 swap swap defaults 0 0
Now check mount point with command “ mount -a









































No comments:

Post a Comment

Linux Tables: Block All Incoming Traffic But Allow SSH

  This is very common scenario. You want to permit access to a remote machine only by SSH. You would like to block all incoming traffic to y...