use dot file in linux

Hi,
I am creating a phonebook to store the name:phone:address.The phonebook is used to store, edit,delete and list the data. Now i need to use text file(dot files) for configuration (saving and loading selections). I really don't know how to do that. Please help
thanks..

Use it the same way you would any other file.

Sorry I am new to Linux. I didn't get what you mean. Can you please let me know in detail how to start that. Thanks in advance

  1. If you use vim editor to create text files, it will be like.
vim myphone.txt

If you want to create the dot file ( hidden file in Linux ).

vim .myphone.txt

Note: Prepended . ( dot )

  1. In cat the same way.

  2. Also if you are doing inside your program, while opening the file prepend the name of the file with . ( dot ).

Thats all, Got it ?!

Thanks!! Just a quick question. Is dot file like a database, where we saved the data of phonebook..

dot in front makes the files hidden file. but you can see with ls -a (-a option).

What you are asking about phone book is a big project !! look around on web, you might find something similar or pay someone to do the project for you.

Incase you are intrested Look at following in any scripting language:

How to create arrays ?
How to open files in read/write and append mode ?
How to separate records from a line you have read ?
What are hashes and how do you do a hash lookup
How to do a array lookup ?

A dot file is like any other file: it can contain anything you like.

The only difference between a dot file and any other file is that, by default, it is not listed with ls or included in shell wildcard expansion.

If you want to keep your database in a dot file, you can.