Linux file/directory naming conventions

Linux file/directory naming conventions

Post by Forrest Samue » Wed, 15 Jan 2003 06:09:19



Is there a standard naming convention for files and directories in
Linux? I heard at some point that directories should be upper case
(i.e. - "Files") and files should be lowercase (i.e. - "myfile"). Also
are there any issues with spaces versus underscores. Does anyone know
of any howtos that address this??

Thanks!

-Forrest

 
 
 

Linux file/directory naming conventions

Post by Davi » Wed, 15 Jan 2003 06:19:59



> Is there a standard naming convention for files and directories in
> Linux? I heard at some point that directories should be upper case
> (i.e. - "Files") and files should be lowercase (i.e. - "myfile"). Also
> are there any issues with spaces versus underscores. Does anyone know
> of any howtos that address this??

File names can be what ever you choose to use, just remember that
Linux is case sensitive.

RedHat   Redhat   redhat   # these are not the same file.

It is generally a bad practice to use spaces in filenames though
it can be done.
If you want to see why try this in a empty directory.

touch   this is a test

Then try it like this.

touch "this is a test"

--
   Confucius:  He who play in root, eventually kill tree.
Registered with the Linux Counter.  http://counter.li.org

 
 
 

Linux file/directory naming conventions

Post by Johan Kullsta » Sat, 18 Jan 2003 07:23:36



> Is there a standard naming convention for files and directories in
> Linux? I heard at some point that directories should be upper case
> (i.e. - "Files") and files should be lowercase (i.e. - "myfile").

That is a hack to cause "ls" to sort directories before file.  I use
this myself, but it is not a hard and fast rule.  Use it if you like
it; if not, no big deal.  I have also, in the past, hacked ls to sort
by file type.

Quote:> Also
> are there any issues with spaces versus underscores. Does anyone know
> of any howtos that address this??

A space is the shells way of seperating arguments.  Spaces are more
annoying within filenames since you need to quote them (surround by "" or
'' or use backslash to quote a single space) when typing the filename
on the command line.  This can also bite you when feeding the
output of, e.g., find into xargs.  Use -print0 with find and the -0
xargs and you should be ok.  Otherwise, spaces are just like any other
character.

Sometimes I wish unix had a little more enforcement on allowable
filename chars since control characters in your filename can be
moderately annoying but with any redeeming quality apparent to me.

--

 
 
 

Linux file/directory naming conventions

Post by Pascal Bourguigno » Sat, 18 Jan 2003 13:52:20




> > Is there a standard naming convention for files and directories in
> > Linux? I heard at some point that directories should be upper case
> > (i.e. - "Files") and files should be lowercase (i.e. - "myfile"). Also
> > are there any issues with spaces versus underscores. Does anyone know
> > of any howtos that address this??

> File names can be what ever you choose to use, just remember that
> Linux is case sensitive.

> RedHat   Redhat   redhat   # these are not the same file.

> It is generally a bad practice to use spaces in filenames though it
> can be done.
> If you want to see why try this in a empty directory.

> touch   this is a test

> Then try it like this.

> touch "this is a test"

Usually, unix  files are written  in low-case because it's  easier (no
need to do gymnastic to reach shift!). By the same token, the dash (-)
may be more used than the underscore (_).

But then, you're entirely free to choose your own conventions.

For example, I name my Modula-2 files by the name of the module, which
is case  sensitive like unix  and for which  I use a  convention like:
PjbMyModule,  which  gives  files: PjbMyModule.mi  and  PjbMyModule.md
(module implementation and module  definition).  But otherwise, I tend
to use lower-case and dashes.

Otherwise,  there  are  some   standard  for  the  standard  top-level
directory names.  Filesystem Hierarchy Standard, FHS:
http://www.pathname.com/fhs/

--
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
There is a fault in reality. Do not adjust your minds. -- Salman Rushdie

 
 
 

Linux file/directory naming conventions

Post by J?rn Dahl-Stamn » Tue, 21 Jan 2003 17:29:43




>Usually, unix  files are written  in low-case because it's  easier (no
>need to do gymnastic to reach shift!). By the same token, the dash (-)
>may be more used than the underscore (_).

>But then, you're entirely free to choose your own conventions.

I choose to use small letters on files. Directories got a first uppercase
letter, like ~/Archive. Sometime several uppercase letters are also OK, like
~/ProjectBackups.

J?rn Dahl-Stamnes, EDB Teamco AS

web: http://spiderman.novit.no/dahls/

 
 
 

1. Directory naming conventions?

Hi there!

You know, there are standard conventions for naming directories
under linux systems, like /etc for configuration files, /sbin
for system binaries (that used to be in /etc), /usr/local for
LOCAL binaries etc....
But is there also a naming convention for subdirectories containing
user software like plotting programs, analysis tools, WWW browsers,
that could be shared over a network?
To make it clear: When we started to download useful software from
the internet, it was mostly GNU software and we put it under
/usr/gnu (/usr/gnu/bin). Today, the name does not render well the
contents any more, so what would be the appropriate name
(/usr/share?  /usr/contrib? or what)?
Any conventions? Any suggestions?

Greetings,
        Boris

--

office: Universitaet des Saarlandes   Theoretische Physik   Bau 38 1.21
        Postfach 151150   D-66041 Saarbruecken    
        voice: +49-(0)681-302-4221             fax: +49-(0)681-302-4316
home  : Muehlenberg 5   D-66809 Nalbach         voice: +49-(0)6838-3085

2. slackware umsdos setup

3. Conventions for file name "extensions"

4. breaking out of accept()

5. Startup file naming convention

6. ACPI/S3: fix gcc3.2 compatibility

7. Named file attributes (s9 and later) - any conventions?

8. Mouse installation (PS/2) gives a big blank square

9. Lock file naming convention in Solaris 8

10. Unix file naming conventions

11. Subject: SCO OPEN SERVER & WIN95 - file name conventions and other problems

12. Dynamic Library File Naming Conventions ??

13. File system naming conventions