Linux doesnt see most file extensions - there are some exceptions. Is smb.conf one of them? Linux n00b

It can be renamed to smb.bak for a backup so Im presuming its one of the exceptions.

I speed read Linux doesnt need most file extensions but dont recall it all.  Can you explain why it hasnt and how it manages without the need extensions like windows?

Who is Participating?
Unlike Windows, Linux does NOT care about your file extensions.  You can make files without ANY extension, you can make file with names like name.longextension and you can also make like  It does not categorize files like that.

One way Linux does is by -- analyzing file type.

So if you do

file <filename>

It would tell you the file type.
Conf is also no exception.  It is just to make it readable to you.  If you wish, you can make extensions like txt or .dat or whatever.  But as I said, the OS would not classify it with the extension names.  It would do it as you see in the file command
It is the file content that makes the difference here. Also, permissions attached to file (ls -l listing) tells you, if the same can be executed, read, updated.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

samba will always look for smb.conf as its starting file, after that you can include any filename from within smb.conf to extend it
fcekAuthor Commented:

So how does samba know which file to read?  The first two are backups

-rw-r--r--    1 root root 12672 Mar  8 18:04 smb.bak
-rw-r--r--.   1 root root 11831 Mar  7 22:17 smb.bk
-rw-r--r--    1 root root 15043 Mar 23 02:10 smb.conf
fcekAuthor Commented:
It is included in the binary -- the programmer wrote it this way.

if you get the source code and change the name to fcek.configuration, you can.

I would like you to issue this command as root
strings $(which smbd) | grep smb.conf

Open in new window

The above command shows you the string contents of the binary, which the information is stored as to which file it is supposed to read.

In Unix/Linux some times there environment variables setting the names of files to be checked.
its not directly written by the programmer, when the program is compiled there is an option to specify where the config file is, some users like it in /etc/samba/ others in /usr/local/etc/ etc etc, it can be overriden though by a file in /etc/sysconfig/samba, you add -s etc to the start params
Well pointed out by tsmgeek.

I didn't want to go into these details-- typical programming practices are to keep various values configurable at various levels, by using install options, etc.

Yes I changed to line in /etc/sysconfig/samba to read as
SMBDOPTIONS="-D -s /etc/samba/smb.config"

And now it reads from the above mentioned file, as its config file.
Thanks tsmgeek for pointing at out.  Nonetheless, the binary contained the name of file as I mentioned above and the command.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.