Wednesday, November 30, 2011

NFC- NEAR FILED COMMUNICATION- A PATH BREAKING TECHNOLOGY

Hi friends ,
 
Last week I saw an Nokia Ad in the TV showing two friends sharing music,picture and playing games simply by tapping their phones against each other , something like in sci-fi movie.It got me intrigued and i found out  that the technology behind  this was "NFC -near field communication".
Co-invented by NXP Semiconductors and Sony in 2002, Near Field Communication, or NFC, allows you to share, interconnect many devices, make mobile payments, read NFC-enabled tags and even do multi-player gaming by tapping your device against your friends' cool isn't :) . 
Well you may now ask that , why on earth do i need NFC when we have the Blue-tooth technology that allow you to do exactly the same things like NFC.Well then here's some fact :
1) NFC is  a gesture based (touch-tap ) process which makes it easier than the two to three step process for Bluetooth.
2)For it to work, both the interacting devices need to be embedded with NFC chips. These chips operate in a short range, generally around 4 cm or less. The speed of data transfer is around 440 kilobits per second which is more than enough for applications like reading card information or connecting devices.Well this speed is at least 10-20 times faster than bluetooth transfer rate.
3)NFC enabled phones which have your credit card information stored enables you to make mobile payments by tapping against the credit card reader without physically swapping the card , so you no longer need your credit cards.
4)On your way back from office, the hit song of the latest Bollywood blockbuster catches your attention. Loving the tune, you walk into a nearby music store. You reach for the film's poster, touch your phone against it and tap it.
It downloads the song and even makes the payment. You share it with friends by 'touch-tap' again and, finally, you reach home and 'touch-tap' the phone with your home entertainment system to listen to the music in all its glory. This may seem like sci-fi but the technology behind it is already here.ALL this is possible with NFC.

So whats your take Bluetooth or NFC ?

In India, Apple and Samsung have launched NFC enabled phones on iOS and Android respectively . Nokia has also launched six NFC phones and Blackberry-maker RIM two phones. This means that a NFC handset is available for as low as Rs 11,000 today.

Sunday, November 27, 2011

Tivoli Storage Manager Commands (TSM)

q sess   To see currently working sessions

can sess  ( sess no)  To cancel a session

q eve domainname schedulename    To see schedule time,nodename, scgedule name and progress of the scheeduled backup. ( q eve * * to see all scheduled backups)
q proc    To see currently running background processes 


cancel process (process no)    To cancel a process

q node   To view assigned nodes in a Tivoli server 


q filespace   To check backup space utilized for each file system of a server, filesystem type...
q actlog  To view activity log


q act begind=mm/dd/yyyy begint=hh:mm:ss  endd=mm/dd/yyyy endt=hh:mm:ss     To view activity log for a specified period by begining date and end date


q act begind=today-1 begint=00:00   To view activity log from yesterday 12:00 am


q act search=transferred begint=00:00   To see all completed backup size of servers from 12:00 am


q act search=nodename     To view activity log for a node

q drive f=d   To get detailed report of drive, it's status ... 

q library f=d    To get detailed information about tape library  

q libvol    To see volumes in the tape library and it's status

q vol   To see volumes and it's storage pool name, capacity, status 

q req     To see requests 

reply (request no)  To continue request 

q sched     To show schedule name domain, action , start date & time 

q sched f=d   To show detailed report about schedules including schedule backup path

UPDATE LIBVOLUME TS3200 L41117L4  STATUS=SCRATCH    To change a library volume ( L41117L4 ) status to scratch from private 

update node nodename "admin" domain=domainname forcepwreset=Yes    To change a tivoli login password of a node

define vol storagepoolname L41116L4    Add new tape L41116L4 to a storagepool


delete volume L41116L4 discarddata=yes    To delete data inside a tape media L41116L4



To create a new schedule backup (incremental ) for a node

UPDATE SCHEDULE domainname nodename desc="daily incremental backup for a server" action=Incremental options=-subdir=yes objects=""/fs1/*" "/fs2/*" "/home/user1/*"" priority=5startdate=mm/dd/yyyy starttime=hh:mm duration=1 duru=Houperiod=1 perunits=Day dayofweek=Any expiration=never


To start tivoli services in an AIX client

#cd /usr/tivoli/tsm/client/ba/bin

nohup dsmc sched &     To start scheduled backup service


nohup dsmcad &   To start BA client ( webmode backup i.e. http://ip.address.of.server>:1581)
#cd /usr/tivoli/tsm/StorageAgent/bin

nohup ./dsmsta &        To start storage agent ( LANFREE BACKUP= backup directly from SAN to Tape library )  

#ps -ef | grep dsm     To view currently running Tivoli services in server


To update drive status of a server to online

update path sourceservername TAPE0 srct=server destt=drive libr=ts3200 online=yes  
To set serial number of a drive in tape library

UPDATE DRIVE TS3200 TAPE0 ELEMENT=autodetect ONLINE=Yes WWN="2002000E11107B6C" SERIAL=autodetect


To detect label of a tape in tape library

label libvol t3200 checkin=scratch labelsource=barcode search=bulk waittime=0
 


To remove tape media from tape library

checkout libvol ts3200 VOLLIST=A00015L3,A00019L3 CHECKLABEL=YES REMOVE=YES


To add and label new tapes into library
LABEL libvol TS3200 search=yes labelsource=barcode overwrite=NO checkin=SCRATCH WAITTIME=0
 


To take full backup of Tivoli database manually to a file in local disk

backup db dev=FILECLASS type=full


to assign a tape drive to a server
=======================

UPDATE PATH servername TAPE0 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=TS3200 DEVICE=\\.\Tape0 ONLINE=YES AUTODETECT=no

Important

If you are not able to take backup through any of Tivoli backup methods ( BA client, dsmc , schedule ) then check any NFS mounted filesystems are there in the server and that server is available or not. If that server is not powered on, either unmount the NFS filesyatem or make that server available...

Monday, August 15, 2011

Cool SocialNetworking sites taking the webworld with a bang (made by Indian)

Hi All,
1)Resume (http://www.resu.me/) :
similar to LINKEDIN but has a better interactive interface .It has a 3D interface to create an interactive portfolio of your job CV. It allows you to catch the eye of various companies by allowing you to create amazing 3D portfolio.It helps you to connect to various professional of your field. Its being developed by three Indian born Stanford university students . Try it its great.
Join me at Resume at :http://saikatmbka.resu.me/















2)SpeakingTree (http://www.speakingtree.in/) :

An TOI initiative a great social networking and blogging site for all you spiritual people. Great people like Sri Sri Ravi Shankar and many other enlightened people preach sermons via this site, you can follow them and get enlighted too. You to can preach and be followed my friends and lovers.Great stuff.

Sunday, August 7, 2011

SOME INTERESTING WEBSITES

Hi All,

1.TINEYE  (http://www.tineye.com/ )


A search engine where you can upload a picture and it will tell you which are the sites where that photo will be found in the web world.
Upload your photo and try out....





TinEye is a reverse image search engine developed and offered by Idée, Inc., a company based in Toronto, Canada, which was founded by Leila Boujnane and Paul Bloore in 1999.The use of the Web application is free of charge for customers. According to the company, TinEye is the first web-based image search engine to use image identification technology. 
A user uploads an image to the search engine (the upload size is limited to 1 MB) or provides a URL for an image or for a page containing the image. The search engine will look up other usage of the image in the internet including their time of appearance and including modified images based upon that image. Tineye does not recognise objects or persons in an image, it recognises the entire image, and some altered versions of that image. This includes smaller, larger, and cropped versions of the image. In addition, TinEye has shown itself capable of retrieving different images from its database of the same subject, such as famous landmarks. TinEye is capable of searching for images in JPEG, GIF, or PNG format. Currently, other formats that contain images online, such as Adobe Flash, are not searchable.

2.Online Image Editor (http://www.online-image-editor.com/)



here is a cool site that allows you to animate any picture , you can add glitters, cool animations , flowers , and alot of other effect to your picture and make it look cool....try it out.


3.FIELDI (http://www.fieldi.com/)


Its an unique website that is like a social network for budding writters , lyricst and other creative people.It provides a free Social Media Publishing platform where you can publish your books or can read books written by others all for free. Really a supercool website.

Thursday, June 30, 2011

GOOGLE _ DOODLE

Hi All,

               EPITOME OF CREATIVITY : THE GOOGLE DOODLE                             




Doodle History

Over the years, doodles on the Google homepage have made searching on Google more fun and enjoyable for its users worldwide. When doodles were first created, nobody had anticipated how popular and integral they would become to the Google search experience. Nowadays, many users excitedly anticipate the release of each new doodle and some even collect them!
In 1998, the concept of the doodle was born when Google founders Larry and Sergey played with the corporate logo to indicate their attendance at the Burning Man festival in the Nevada desert. A stick figure drawing was placed behind the 2nd "o" in the word, Google and the revised logo was intended as a comical message to Google users that the founders were “out of office.” While the first doodle was relatively simple, the idea of decorating the company logo to celebrate notable events was well received by our users.
A year later in 2000, Larry and Sergey asked current webmaster Dennis Hwang, an intern at the time, to produce a doodle for Bastille Day. Pleased with the result, Dennis was then appointed Google’s chief doodler and doodles became a regular occurrence on the Google homepage. In the beginning, the doodles tended to celebrate largely visible holidays; nowadays, doodles represent a wide array of events and anniversaries from the Winter Games to the Mars Rover landing.
How many doodles has Google done over the years?
The doodle team has created over 300 doodles for Google.com in the United States and over 700 have been designed internationally.
How can Google users/the public submit ideas for doodles?
The doodle team is open to user ideas; requests for doodles can be sent to proposals@google.com. The team receives numerous requests so even if we do not get back to you about your request, please know that we do look at and consider all the requests that are submitted.

Where can I see all the Google doodles that have been done over the years?
All doodles can be found at www.google.com/logos.
also visit :
http://www.google-logos.com/category/google-doodles

Saturday, June 25, 2011

clariion Enclosure Types

Hi All ,
                                                           Enclosure Types


The above page diagrams the back-end structure of a Clariion. How the disks are laid out. Before we discuss the back-end bus structure, we should discuss the different types of enclosures that the Clariion contains.


1.DAE. The Disk Array Enclosure. Disk Array Enclosures exist in all Clariions. DAE’s are the enclosures that house the disks in the Clariion. Each DAE is holds fifteen (15) disks. The disks are in slots that are numbered 0 to 14.


2.DPE. The Disk Processor Enclosure. The Disk Processor Enclosure is in the Clariion Models CX300, CX400, CX500. The DPE is made up of two components. It contains the Storage Processors, and the first fifteen (15) disks of the Clariion.


3.SPE. The Storage Processor Enclosure. The Storage Processor Enclosure is in the Clariion Models CX700 and the CX-3 Series. The SPE is the enclosure that houses the Storage Processors.



The diagrams above lay out the DAE’s back-end bus structure. Data that leaves Cache and is written to disk, or data that is read from disk and placed into Cache travels along these back-end buses or loops. Some Clariions have one back-end bus/loop to get data from enclosure to enclosure. Others have two and four back-end buses/loops to push and pull data from the disks. The more buses/loops, the more expected throughput for data on the back-end of the Clariion.


The Clariion Model on the left is a diagram of a CX300/CX3-10 and CX3-20. These models have a single back-end bus/loop to connect all of the enclosures. The CX300 will have one back-end bus/loop running at a speed of 2 GB/sec, while the CX3-Series Clariions have the ability to run up to 4 GB/sec on the back-end.


The Clariion Model in the middle is a diagram of a CX500. The CX500 has two back-end buses/loops. This gives the CX500, twice the amount of potential throughput for I/Os than the CX300.


The Clariion Model on the right is a diagram of a CX700, CX3-40 and CX3-80. These Clariions contain four back-end buses/loops. The CX3-80 will contain the maximum back-end throughput with all four buses having the ability to run at a 4 GB/sec speed.


Each enclosure has a redundant connection for the bus that it is connected. This is in the event that the Clariion loses a Link Control Card (LCC) that allow the enclosures to move data, or the loss of a Storage Processor. You will see one bus cabled out of SP A and SP B, allowing both SP’s access to each enclosure.



Enclosure Addresses


To determine an address of an enclosure, we need to know two things, what bus it is on, and what number enclosure it is on that bus. On the Clariions in the left diagram, there is only one back-end bus/loop. Every enclosure on these Clariions will be on Bus 0. The enclosure numbers start at zero (0) for the first enclosure and work their way up. On these Clariions, the first enclosure of disks is labeled Bus 0_Enclosure 0 (0_0). The next enclosure of disks is going to be Bus 0_Enclosure 1 (0_1). The next enclosure of disks 0_2, and so on.


The CX500, with two back-end buses will alternate enclosures with the buses. The first enclosure of disks will be the same as the Clariions on the left of Bus 0_Enclosure 0 (0_0). The next enclosure of disks will utilize the other back-end bus/loop, Bus 1. This enclosure is Bus 1_Enclosure 0 (1_0). It is Enclosure 0, because it is the first enclosure of disks on Bus 1. The third enclosure of disks is going to be back on Bus 0, 0_1. The next one up is on Bus 1, 1_1. The enclosures will continue to alternate until the Clariion has all of the supported enclosures. You might ask why it is cabled this way, alternating buses. The reason being is that most companies don’t purchase Clariions fully populated. Most companies buy disks on an as needed basis. By alternating enclosures, you are using all of the back-end resources available for that Clariion.

The Clariions on the right show the four bus structure. The first enclosure of disks is going to be Bus 0_Enclosure 0 (0_0) as all other Clariions. The next enclosure of disks is Bus 1_Enclosure 0 (1_0). Again, using the next available back-end bus, and being the first enclosure of disks on that bus. The third DAE is going to be Bus 2_Enclosure 0 (2_0). The fourth DAE is on the fourth and last back-end bus. It is Bus 3_Enclosure 0 (3_0). From here, we are back to Bus 0 for the next enclosure of disks. Bus 0_Enclosure 1 (0_1). The next DAE is 1_1. The next would be 2_1 if we had one. 3_1, 0_2, and so on until the Clariions were fully populated.


Disk Address


The last topic for this page are the disks themselves. To find a specific disk’s address, we use the Enclosure Address and add the Slot number the disk is in. This gives us the address that is called the B_E_D. Bus_Enclosure_Disk. The Clariion on the left has a disk in slot number 13. The address of that disk would be 0_2_13. The Clariion in the middle has a disk in slot number 10 of Enclosure 1_1. This disk address would be 1_1_10. And the Clariion on the right has a disk in Bus 2_Enclosure 0. It’s address is 2_0_6. And the disk in Bus 1_Enclosure 1 is in slot 9. Address = 1_1_9.


Finally, each Clariion has a limit to the number of disks that it will support. The chart below the diagrams provides the number of how many disks each model can contain. The CX300 can have a maximum of 60 disks, whereas the CX3-80 can have up to 480 disks.


The importance of this page is to know where the disks live in the back of the Clariion in the event of disk failures, and more importantly how you are going to lay out the disks. Meaning, what applications on going to be on certain disks. In order to put that data onto disks, we have to create LUNs (will get to it), which are carved out of RAID Groups (again, getting there shortly). RAID Groups are a grouping of disks. To have a nice balance and to achieve as much performance and throughput on the Clariion, we have to know how the Clariion labels the disks and how the DAE’s are structured.

Tuesday, June 14, 2011

EMC DMX, DMX2: Model numbers, basic differences, 3 Phase, Single Phase, Drive counts, Drives per loop

Hi All,
The basic differences on DMX and DMX2 machines. Based on some data I had put together, here are the major differences on a DMXxxxx vs a DMX-P2 vs a DMX-M2-3, etc. 
The number of drives per loop: the lesser the drives on a single loop the better the performance. There are two different versions of drives per loop: one being the 9 drives per loop and the other one being 18 drives per loop.
Following are all 18 drives per loop

DMX1000:   
Low Performance,
1st Generation DMX,
18 drives per loop,
Single Bay with Single Phase power,
144 drives max. 

DMX1000-M2:        
High Performance,
2nd Generation DMX,
18 drives per loop,
Single Bay with Single Phase power,
144 drives max.

DMX2000:              
Low Performance,
1st Generation DMX,
18 drives per loop,
Dual Bay with Single Phase power,
288 drives max. 

DMX2000-M2:        
High Performance,
2nd Generation DMX,
18 drives per loop,
Dual Bay with Single Phase power,
288 drives max.

DMX2000-M2-3:     
High Performance,
2nd Generation DMX,
18 drives per loop,
Dual Bay with Three Phase power,
288 drives max. 

DMX3000-3:           
Low Performance,
1st Generation DMX,
18 drives per loop,
Triple Bay with Three Phase power,
576 drives max . 

DMX3000-M2-3:     
High Performance,
2nd Generation DMX,
18 drives per loop,
Triple Bay with Three Phase power,
576 drives max.

Following are all 9 drives per loop

DMX1000-P:           
Ultra Performance, 1st Generation DMX,
9 drives per loop,
Single Bay with Single Phase power,
144 drives max. 

DMX1000-P2:         
Ultra Performance,
2nd Generation DMX,
9 drives per loop,
Single Bay with Single Phase power,
144 drives max.

DMX2000-P:           
Ultra Performance,
1st Generation DMX,
9 drives per loop,
Dual Bay with Single Phase power,
288 drives max.

DMX2000-P2:         
Ultra Performance,
2nd Generation DMX,
9 drives per loop,
Dual Bay with Single Phase power,
288 drives max. 

DMX2000-P2-3:      
Ultra Performance,
2nd Generation DMX,
9 drives per loop,
Dual Bay with Three Phase power,
288 drives max. 

Machines are categorized as a DMX and DMX2,DMX3,DMX4 The ones above with a P2 or M2 are DMX2. 
The new generation of DMX machine’s now available in the market are: DMX-3 and DMX-4. the latest one is VMAX it supports flashdrives also.

Wednesday, April 27, 2011

use google as a calculator

Hi All,
 Most of the people using google search engine for finding the content .so now use the search engine as a calculator .
go to http://www.google.com
in text type the
3+6 or 45%8
just like that u can enter what ever you want and find the result.
that's simple
comment on posts to improve the post
thanks for visiting ........

Sunday, April 17, 2011

How to configure linux print server

Hi All,
Linux uses the Common UNIX Printing System, also known as CUPS. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and print sharing. The /etc/cups/ directory stores all the configuration files for printing. However, these files can be easily managed with the Printer Configuration Tool in Linux.
Exam question Raw (Model) printer named printer1 is installed and shared on 192.168.0.254. You should install the shared printer on your PC to connect shared printer using IPP Protocols.
Exam question Raw printer named printerx where x is your station number is installed and shared on server1.example.com. Install the shared printer on your PC to connect shared printer using IPP Protocols. Your server is 192.168.0.254.
Before you can use any printer, you first have to install it on a Linux system on your network. To start the Printer Configuration Tool, go to the System menu on the top panel and select Administration, Printing or execute the command system-config-printer.
printer path
If no printers are available for the system, only the Server Settings view is available for selection. If local printers are configured, a Local Printers menu will available.

Install new printer

click New Printer on the toolbar.
new printer
In the dialog window that appears, accept the default queue name or change it to a short, descriptive name that begins with a letter and does not contain spaces. Then select printer from list and click on forward and click on finsh.
spool directories
When your system prints a file, it makes use of special directories called spool directories. The location of the spool directory is obtained from the printer's entry in its configuration file. On Linux, the spool directory is located at /var/spool/cups under a directory with the name of the printer.
print job
A print job is a file to be printed. When you send a file to a printer, a copy of it is made and placed in a spool directory set up for that printer.
classes
CUPS features a way to let you select a group of printers to print a job instead of selecting just one. That way, if one printer is busy or down, another printer can be automatically selected to perform the job. Such groupings of printers are called classes. Once you have installed your printers, you can group them into different classes.
Once you have successfully installed local printer it will show in right pane. and in left pane you can see all administrative options.
printer option
  • To view shared printer on other system Tick mark on first option
  • To share locally attached printer tick mark on second option
  • To allow remote administration of this printer check mark on third option
Tick mark on appropriate option and click on apply
share printer from server

configure window clients

Go on window system and ping from printer server and open internet explorer and give the ip address of server with printer port 631
internet explorer
This will launch CUPS web application click on manage printer
manage printer
now you will see the shared printer on server click on print test page
print test page
A test page will be send on printer server copy this url of printer
copy url
click on start button select printer and fax and click on add new printer. this will launch add new printer wizard click next on welcome screen and select network printer
network printer
On this screen select internet printer and paste the url which you copied from internet explorer
internet printer
Install appropriate driver from list or use have disk option you have drive cd and click next. On next screen set this printer defaults and click on next and finish.
set defaults

Remote administration of print server

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on go to server
go to printer server
Now give print server ip address
ip address of print server
It will take few minute to connect from server depending on network speed
connecting
Now give root password to connect printer server
root password
you can see all print administrative Manu in right pane Once you have connected with sever
print server options

configure Linux clients

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on new printer
new printer
Click on forward In the next New Printer screen, select the type of connection to internet printing protocols and in hostname give server ip and printer name in printername
select ipp
select the appropriate model. If multiple drivers are available, select the one most appropriate for your configuration. If you do not want to choose the default and click forward and finish. The main Printer Configuration window should now include the name of your printer.
make default
To print test page click on print test page and a test page will send to print server
print test page

Managing Printers from the Command-Line

The lpadmin command enables you to perform most printer administration tasks from the command-line.
lpadmin

lpc      To view all known queues
lpr      To send print requests to any local print queue
lpq      To see the print queue
lprm     To delete the jobs of your choice use it  with the job number
lp       To print any file.
lpadmin

Monday, April 4, 2011

How to install Linux / UNIX *.tar.gz tarball files

Hi All,
In linux we are using .tar for taking back up of files in compression.so default rpm packege we can install easily but some software are including source code available in .tar format .so now i am going to show you how to install like these format files in linux/unix.

tar.gz also known as tarball, an archive format for electronic data and software. Most Linux tarball contains a source code for software. If you are new to Linux I recommend using apt-get, rpm and yum command to install all binary packages.
Tarballs are a group of files in one file. Tarball files have the extension .tar.gz, .tgz or .tar.bz2. Most open source software use tarballs to distribute programs/source codes.

# 1: Uncompress tarball

To uncompress them, execute the following command(s) depending on the extension:
$ tar zxf file.tar.gz
$ tar zxf file.tgz
$ tar jxf file.tar.bz2
$ tar jxf file.tbz2

Now change directory

$ ls
$ cd path-to-software/

# 2: Build and install software

Generally you need to type 3 commands as follows for building and compiling software:
# ./configure
# make
# make install
Where,
  • ./configure will configure the software to ensure your system has the necessary functionality and libraries to successfully compile the package
  • make will compile all the source files into executable binaries.
  • Finally, make install will install the binaries and any supporting files into the appropriate locations.

# 3: Read INSTALL / README file

Each tarball comes with installation and build instructions. Open INSTALL or README file for more information:
$ vi INSTALL

Sunday, March 27, 2011

Vi editor guide how to use command

Hi All,
Critical to a Linux administrator is knowledge of one or more text editors to manage the many configuration files on a Linux system. The Linux file system hierarchy organizes hardware, drivers, directories, and of course, files. You need to master a number of basic commands to manage Linux. Printer configuration can be a complex topic. Shell scripts enable you to automate many everyday processes. Security is now a huge issue that Linux can handle better than other operating systems; locally, and on larger networks such as the Internet.

The VIsual Editor

Linux and Unix are managed through a series of text files. Linux administrators do not normally use graphical editors to manage these configuration files. Editors such as WordPerfect, starOffice, and yes, even Microsoft Word normally save files in a binary format that Linux can't read. Popular text editors for Linux configuration files include emacs, pico, joe, and vi.
While emacs may be the most popular text editor in the world of Linux, every administrator needs at least a basic knowledge of vi. While emacs may be more popular and flexible, vi may help you save a broken system. If you ever have to restore a critical configuration file using an emergency boot floppy, vi is probably the only editor that you’ll have available. You need to know how to restore your system from a rescue floppy, which does not have enough room to carry any editor other than vi.So should know how to use vi editor.
$ vi /tmp/test
If this is a new file, you should see something similar to the following:
~
~
~
~
~
“/tmp/test” [New File]
The box at the top represents where your cursor is. The bottom line keeps you informed about what is going on with your editing (here you just opened a new file). In between, there are tildes (~) as filler because there is no text in the file yet. Now here's the intimidating part: There are no hints, menus, or icons to tell you what to do. On top of that, you can't just start typing. If you do, the computer is likely to beep at you. And some people complain that Linux isn't friendly.
The first things you need to know are the different operating modes: command and input. The vi editor always starts in command mode. Before you can add or change text in the file, you have to type a command (one or two letters and an optional number) to tell vi what you want to do. Case is important, so use uppercase and lowercase exactly as shown in the examples! To get into input mode, type an input command. To start out, type either of the following:
  • a-The add command. After it, you can input text that starts to the right of the cursor.
  • i-The insert command. After it, you can input text that starts to the left of the cursor.
Type a few words and then press Enter. Repeat that a few times until you have a few lines of text. When you’re finished typing, press Esc to return to command mode. Now that you have a file with some text in it, try moving around in your text with the following keys or letters: Remember the Esc key! It always places you back into command mode.
Arrow keys-Move the cursor up, down, left, or right in the file one character at a time. To move left and right you can also use Backspace and the space bar, respectively. If you prefer to keep your fingers on the keyboard, move the cursor with h (left), l (right), j (down), or k (up).
  • w-Moves the cursor to the beginning of the next word.
  • b-Moves the cursor to the beginning of the previous word.
  • 0 (zero)-Moves the cursor to the beginning of the current line.
  • $-Moves the cursor to the end of the current line.
  • H-Moves the cursor to the upper-left corner of the screen (first line on the screen).
  • M-Moves the cursor to the first character of the middle line on the screen.
  • L-Moves the cursor to the lower-left corner of the screen (last line on the screen).

The only other editing you need to know is how to delete text. Here are few vi commands for deleting text:
  • x-Deletes the character under the cursor.
  • X-Deletes the character directly before the cursor.
  • dw-Deletes from the current character to the end of the current word.
  • d$-Deletes from the current character to the end of the current line.
  • d0-Deletes from the previous character to the beginning of the current line.

To wrap things up, use the following keystrokes for saving and quitting the file:
  • ZZ-Save the current changes to the file and exit from vi.
  • :w-Save the current file but continue editing.
  • :wq-Same as ZZ.
  • :q-Quit the current file. This works only if you don’t have any unsaved changes.
  • :q!-Quit the current file and don’t save the changes you just made to the file.
If you've really trashed the file by mistake, the :q! command is the best way to exit and abandon your changes.
The file reverts to the most recently changed version. So, if you just did a :w, you are stuck with the changes up to that point. If you just want to undo a few bad edits, press u to back out of changes.
You have learned a few vi editing commands. I describe more commands in the following sections. First, however,
here are a few tips to smooth out your first trials with vi:
  • Esc-Remember that Esc gets you back to command mode. (I’ve watched people press every key on the keyboard trying to get out of a file.) Esc followed by ZZ gets you out of command mode, saves the file, and exits.
  • u-Press u to undo the previous change you made. Continue to press u to undo the change before that, and the one before that.
  • Ctrl+R-If you decide you didn’t want to undo the previous command, use Ctrl+R for Redo. Essentially, this command undoes your undo.
  • Caps Lock-Beware of hitting Caps Lock by mistake. Everything you type in vi has a different meaning when the letters are capitalized. You don’t get a warning that you are typing capitals-things just start acting weird.
  • :! command-You can run a command while you are in vi using :! followed by a command name. For example,
  • type :!date to see the current date and time,
  • type :!pwd to see what your current directory is,
  • type :!jobs to see if you have any jobs running in the background.
  • INSERT-When you are in insert mode, the word INSERT appears at the bottom of the screen.
  • Ctrl+G-If you forget what you are editing, pressing these keys displays the name of the file that you are editing and the current line that you are on at the bottom of the screen. It also displays the total number of lines in the file, the percentage of how far you are through the file, and the column number the cursor is on.

Moving Around the File

Besides the few movement commands described earlier, there are other ways of moving around a vi file. To try these out, open a large file that you can’t do much damage to. (Try copying /var/log/ messages to /tmp and opening it in vi.) Here are some movement commands you can use:
  • Ctrl+F-Page ahead, one page at a time.
  • Ctrl+B-Page back, one page at a time.
  • Ctrl+D-Page ahead one-half page at a time.
  • Ctrl+U-Page back one-half page at a time.
  • G-Goto the last line of the file.
  • 1G-Go to the first line of the file. (Use any number to go to that line in the file.)

Searching for Text

To search for the next occurrence of text in the file, use either the slash (/) or the question mark (?) character. Follow the slash or question mark with a pattern (string of text) to search forward or backward, respectively, for that pattern. Within the search, you can also use metacharacters. Here are some examples:
  • /hello-Searches forward for the word hello.
  • ?goodbye-Searches backward for the word goodbye.
  • /The.*foot-Searches forward for a line that has the word The in it and also, after that at some point, the word foot.
  • ?[pP]rint-Searches backward for either print or Print. Remember that case matters in Linux, so make use of brackets to search for words that could have different capitalization.
The vi editor was originally based on the ex editor, which didn’t let you work in full-screen mode. However, it did enable you to run commands that let you find and change text on one or more lines at a time. When you type a colon and the cursor goes to the bottom of the screen, you are essentially in ex mode. Here is an example of some of those ex commands for searching for and changing text. (I chose the words Local and Remote to search for, but you can use any appropriate words.)
  • :g/Local-Searches for the word Local and prints every occurrence of that line from the file. (If there is more than a screenful, the output is piped to the more command.)
  • :s/Local/Remote-Substitutes Remote for the word Local on the current line.
  • :g/Local/s//Remote-Substitutes the first occurrence of the word Local on every line of the file with the word Remote.
  • :g/Local/s//Remote/g-Substitutes every occurrence of the word Local with the word Remote in the entire file.
  • :g/Local/s//Remote/gp-Substitutes every occurrence of the word Local with the word Remote in the entire file, and then prints each line so that you can see the changes (piping it through more if output fills more than one page).

Using Numbers with Commands

You can precede most vi commands with numbers to have the command repeated that number of times. This is a handy way to deal with several lines, words, or characters at a time. Here are some examples:
  • 3dw-Deletes the next three words.
  • 5cl-Changes the next five letters (that is, removes the letters and enters input mode).
  • 12j-Moves down 12 lines.
Putting a number in front of most commands just repeats those commands. At this point, you should be fairly proficient at using the vi command. Once you get used to using vi, you will probably find other text editors less efficient to use.

Popular Posts

Followers

Disclaimer

All Data and Information Provided on This BLOG is only for Education purposes only.If you done any thing else these in real time the blog is not Responsible.Try all those on your own risk.
IF you find any thing else here as per in violation of copyright law .mail me on srinathceh@gmail.com as soon as possible action will be taken.