# use dot file in linux

**URL:** <https://community.unix.com/t/use-dot-file-in-linux/249873>\
**Category:** Shell Programming and Scripting\
**Created:** [September 23, 2009, 8:24am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873 "2009-09-23T08:24:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolgal](https://community.unix.com/letter_avatar/coolgal/32/5_5575768a8748004e209b776fc1b2916d.png) [@coolgal](https://community.unix.com/u/coolgal)\
**Post date:** [September 23, 2009, 8:24am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/1 "2009-09-23T08:24:37Z")

</div>

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..

---

<div class="post-metadata">

**Author:** ![cfajohnson](https://community.unix.com/user_avatar/community.unix.com/cfajohnson/32/16669_2.png) [@cfajohnson](https://community.unix.com/u/cfajohnson)\
**Post date:** [September 23, 2009, 9:04am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/2 "2009-09-23T09:04:33Z")

</div>

Use it the same way you would any other file.

---

<div class="post-metadata">

**Author:** ![coolgal](https://community.unix.com/letter_avatar/coolgal/32/5_5575768a8748004e209b776fc1b2916d.png) [@coolgal](https://community.unix.com/u/coolgal)\
**Post date:** [September 23, 2009, 7:18pm UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/3 "2009-09-23T19:18:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thegeek](https://community.unix.com/letter_avatar/thegeek/32/5_5575768a8748004e209b776fc1b2916d.png) [@thegeek](https://community.unix.com/u/thegeek)\
**Post date:** [September 23, 2009, 10:55pm UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/4 "2009-09-23T22:55:18Z")

</div>

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

```nohighlight
vim myphone.txt

```

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

```nohighlight
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 ?!

---

<div class="post-metadata">

**Author:** ![coolgal](https://community.unix.com/letter_avatar/coolgal/32/5_5575768a8748004e209b776fc1b2916d.png) [@coolgal](https://community.unix.com/u/coolgal)\
**Post date:** [September 24, 2009, 12:26am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/5 "2009-09-24T00:26:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chakrapani](https://community.unix.com/user_avatar/community.unix.com/chakrapani/32/1650_2.png) [@chakrapani](https://community.unix.com/u/chakrapani)\
**Post date:** [September 24, 2009, 12:37am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/6 "2009-09-24T00:37:56Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![cfajohnson](https://community.unix.com/user_avatar/community.unix.com/cfajohnson/32/16669_2.png) [@cfajohnson](https://community.unix.com/u/cfajohnson)\
**Post date:** [September 25, 2009, 11:09am UTC](https://community.unix.com/t/use-dot-file-in-linux/249873/7 "2009-09-25T11:09:46Z")

</div>

> [@coolgal](#):
>
> Thanks!! Just a quick question. Is dot file like a database, where we saved the data of phonebook..

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.
