[comp.unix.questions] UNIX "dot" files

cathy@ncelvax.UUCP (Cathy Benney) (10/24/89)

	Hello. I have a question. Can anyone tell me why the

	"dot" files- .cshrc, .login, .profile, etc., need to

	have a "dot" as their first character?  What does that

	do within the UNIX system?  Also, are there a limited

	number of "dot" files, or can any file be assigned a

	dot as its first character, and therefore take on some

	special significance within the system?  (And if so, what

	is that special significance?)

	Thanks for taking time to respond.  I am working with 4.3 BSD.

	-Cathy Benney-
	-Port Hueneme, California-

melkins@jarthur.Claremont.EDU (Michael Elkins) (10/25/89)

In article <554@ncelvax.UUCP> cathy@ncelvax writes:
>       ...Can anyone tell me why the
>	"dot" files- .cshrc, .login, .profile, etc., need to
>	have a "dot" as their first character? 

I'm not to sure what the reason is, but that is part of their `fixed' name 
(i.e. the system will only recognize it that way...).  I don't think that
the system would run it if it was only named login or cshrc.

>       What does that do within the UNIX system?

The `dot' tells the UNIX command  ls  not to list it with your other files.
This is nice because you normally don't want to muddle through the extra
files when trying to find the one you want, especially if you have a large
directory.  They WILL be listed if you attach the flag  -a  to ls  (e.g. ls -a)

>       Also, are there a limited
>	number of "dot" files, or can any file be assigned a
>	dot as its first character...

The only limit to the number of files is how much memory your account is 
allocated.

-me
-- 
      __                                * BITNET: melkins@jarthur.Claremont.EDU
 /| /|__  >>>Michael R.G. Elkins<<<     * UUCP:   uunet!jarthur!melkins
/ |/ |__                                *     or  melkins@jarthur.UUCP    
************"ACK !!! ...It's not just a word, but a state of mind."************

davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) (10/25/89)

  Files with a dot as the first character are not display by default
using ls. That keeps them from cluttering the listings. There is nothing
else magic about the dot, and you can use it to keep files out of your
way.

  ls will display these files with the -a option, which is set by
default for root on many systems.

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon

matthew@sunpix.UUCP ( Sun Visualization Products) (10/26/89)

In article <554@ncelvax.UUCP> cathy@ncelvax.UUCP (Cathy Benney) writes:
|
|	Hello. I have a question. Can anyone tell me why the
|	"dot" files- .cshrc, .login, .profile, etc., need to
|	have a "dot" as their first character?  What does that
|	do within the UNIX system?  Also, are there a limited
|	number of "dot" files, or can any file be assigned a
|	dot as its first character, and therefore take on some
|	special significance within the system?  (And if so, what
|	is that special significance?)
|
|	Thanks for taking time to respond.  I am working with 4.3 BSD.
|
|	-Cathy Benney-
|	-Port Hueneme, California-

The only special significance of files with a leading '.' (dot) is that they
are considered "normally" hidden.

The advantage of "normally" hidden files is that they don't clutter up your desktop
during normal operations. Try an 'ls' and then an 'ls -a', and see which one you'd
like all the time.

The only "special" files are '.' and '..'.  They are pointer to the current directory ('.')
and parent directory ('..').  They also make great shorthands for standard operations.

cd .. 

moves you to the current directories' parent directory.

cp /home/hishome/test .

makes a copy of file '/home/hishome/test' in the current directory.


As one instructor told me about UNIX(tm),

	"a file is a file, is a file .................."


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

tale@pawl.rpi.edu (David C Lawrence) (10/26/89)

In <1464@crdos1.crd.ge.COM> davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr):
bill>   ls will display these files with the -a option, which is set by
bill> default for root on many systems.

Minor correction: -A, not -a, is the option toggled on by default for
root on most BSD derived systems.

In <958@friar-taac.UUCP> matthew@sunpix.UUCP (Sun Visualization Products):
Matthew> The only special significance of files with a leading '.'
Matthew> (dot) is that they are considered "normally" hidden.

It's what some have called a conspiracy between ls and the shells.  It
certainly isn't anything intrinsic to the Unix file system.

Matthew> Try an 'ls' and then an 'ls -a', and see which one you'd like
Matthew> all the time.

Actually, I'd prefer -A all the time, which of course can be aliased
for my normal usage.  It lets me know exactly what is in a directory
so I'm not bitten by, for example, someone else's .gdbinit.

Matthew> The only "special" files are '.' and '..'.  They are pointer
Matthew> to the current directory ('.')  and parent directory ('..').

"Special" by name, at least, with the exception of '/'.  Files can be
special in the file system in other ways, with directories, symbolic
links, block- and character-special files, AF_UNIX sockets and named
pipes all being "special" files in their own regard.

Matthew> As one instructor told me about UNIX(tm),
Matthew> 	"a file is a file, is a file .................."

What is this supposed to mean?  A parallel on the poem?  If so, 
"File is a file is a file is a file."  Thorny nit, I realize. :-)

Disclaimer: I'm tired.
-- 
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))

paulb@ttidca.TTI.COM (Paul Blumstein) (10/27/89)

In article <1464@crdos1.crd.ge.COM> davidsen@crdos1.UUCP (bill davidsen) writes:
+
+  ls will display these files with the -a option, which is set by
+default for root on many systems.

Some systems allow a -A option, which is not always documented.
The -A option is like -a, except that it doesn't list . & ..
(which is not interesting).  You may want to alias ls to "ls -A"
if you would like to see the dot files normally (like root does).
=============================================================================
Paul Blumstein       |  "I'm not really bad-- I'm just drawn that way"
Citicorp/TTI         |          - Jessica Rabbit
Santa Monica, CA     +-------------------------------------------------------
{philabs,csun,psivax}!ttidca!paulb  or  paulb@ttidca.TTI.COM
DISCLAIMER: Everything & everyone is hereby disclaimed!

kjk@PacBell.COM (Ken Keirnan) (10/28/89)

In article <1464@crdos1.crd.ge.COM> davidsen@crdos1.UUCP (bill davidsen) writes:
>
>  Files with a dot as the first character are not display by default
>using ls. That keeps them from cluttering the listings. There is nothing
>else magic about the dot, and you can use it to keep files out of your
>way.
>



One other important aspect of "dot" files is they are not expanded by
the shell(s) when using file expansion metacharacters (?*[]). This give
"dot" files some protection from accidental erasure or modification.


Ken Keirnan
Pacific Bell

-- 

Ken Keirnan - Pacific Bell - {att,bellcore,sun,ames,pyramid}!pacbell!pbhyf!kjk
  San Ramon, California	                    kjk@pbhyf.PacBell.COM

whh@PacBell.COM (Wilson Heydt) (11/10/89)

In article <27756@prls.UUCP> gordon@prls.UUCP (Gordon Vickers) writes:
>In article <1373@ssc-bee.ssc-vax.UUCP> maa@ssc-vax.UUCP (Mark A Allyn) writes:
>>'a' option.  Since most account holders' home directories contain
>>a .login, .cshrc, .profile, .rhosts, and sometimes a .suntools for
>   Don't forget: .hosts, .email, .keydef, .mailrc, .msgsrc, .newsrc,
>                 .oldnewsrc, .plan, .pnewsexpert, .rnhead, .rnlast,
>                 .rnlock, .rnsoft, .sig, .tiprc

Yet More:
	.exrc
	.kermrc

    --Hal

=======================================================================
Hal Heydt                             | Two plus two equals five . . .
Analyst, Pacific*Bell                 | for moderately large values
415-823-5447                          | of two.
whh@pbhya.PacBell.COM                 | 

ghe@nucthy.physics.orst.edu (Guangliang He) (11/10/89)

In article <30804@pbhya.PacBell.COM> whh@PacBell.COM (Wilson Heydt) writes:
> In article <27756@prls.UUCP> gordon@prls.UUCP (Gordon Vickers) writes:
> >In article <1373@ssc-bee.ssc-vax.UUCP> maa@ssc-vax.UUCP (Mark A Allyn) writes:
> >>'a' option.  Since most account holders' home directories contain
> >>a .login, .cshrc, .profile, .rhosts, and sometimes a .suntools for
> >   Don't forget: .hosts, .email, .keydef, .mailrc, .msgsrc, .newsrc,
> >                 .oldnewsrc, .plan, .pnewsexpert, .rnhead, .rnlast,
> >                 .rnlock, .rnsoft, .sig, .tiprc
> 
> Yet More:
> 	.exrc
> 	.kermrc
> 

How about these :-)
.article .history .ispell_words .joverc .logout .mushrc .netrc .news_time
.rninit .rnmac ......

=======================================================================
USMAIL:   Guangliang He             |  INTERNET: ghe@PHYSICS.ORST.EDU
          Department of Physics     |  BITNET:   hegl@ORSTVM.BITNET
          Weniger Hall 301          |
          Oregon State University   |
          Corvallis, OR 97331-6507  |  PHONE:    (503) 737-4631
=======================================================================

chittamu@umvlsi.ecs.umass.edu (Satish Kumar .C) (11/11/89)

In article <30804@pbhya.PacBell.COM> whh@PacBell.COM (Wilson Heydt) writes:
>>>'a' option.  Since most account holders' home directories contain
>>>a .login, .cshrc, .profile, .rhosts, and sometimes a .suntools for
>>   Don't forget: .hosts, .email, .keydef, .mailrc, .msgsrc, .newsrc,
>>                 .oldnewsrc, .plan, .pnewsexpert, .rnhead, .rnlast,
>>                 .rnlock, .rnsoft, .sig, .tiprc

>	.exrc
>	.kermrc

How about
  .Xdefaults, .emacs, .fullname, .kshrc, .project, .twmrc,
  .uwmrc, .xinitrc, .xtools, .indent.pro etc.

-- 
	-Satish.
	chittamu@cs.umass.edu
--
The Theory of Objectivity: E = mc++

chung@spencer.cs.uoregon.edu (Wing-kuen Chung) (11/12/89)

In article <13690@orstcs.CS.ORST.EDU> ghe@nucthy.PHYSICS.ORST.EDU (Guangliang He) writes:
>In article <30804@pbhya.PacBell.COM> whh@PacBell.COM (Wilson Heydt) writes:
>> In article <27756@prls.UUCP> gordon@prls.UUCP (Gordon Vickers) writes:
>> >In article <1373@ssc-bee.ssc-vax.UUCP> maa@ssc-vax.UUCP (Mark A Allyn) writes:
>> >>'a' option.  Since most account holders' home directories contain
>> >>a .login, .cshrc, .profile, .rhosts, and sometimes a .suntools for
>> >   Don't forget: .hosts, .email, .keydef, .mailrc, .msgsrc, .newsrc,
>> >                 .oldnewsrc, .plan, .pnewsexpert, .rnhead, .rnlast,
>> >                 .rnlock, .rnsoft, .sig, .tiprc
>> 
>> Yet More:
>> 	.exrc
>> 	.kermrc
>> 
>
>How about these :-)
>.article .history .ispell_words .joverc .logout .mushrc .netrc .news_time
>.rninit .rnmac ......

What about these:
	.Xdefaults, .uwmrc, .xsession, etc.

Just a "small" comment.  8-))
Wingkuen Chung 	\ chung@cs.uoregon.edu			       \Evil Wing     |
P. O. Box 3120	 \ Department of Computer & Information Science )Master is    |
Eugene, OR 97403  \ University of Oregon, Eugene, OR 97403     /Going to      |
(503)686-9838	   \ (503)686-4426			      /Drive You Crazy|

ado@elsie.UUCP (Arthur David Olson) (11/15/89)

> I'd sure like to see a '.dot' directory !

Or, better yet by my lights, a "dot" or "rc" (that is, non-hidden) directory.
-- 
	Arthur David Olson   ado@alw.nih.gov   ADO is a trademark of Ampex.