There's something about File Extensions

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

There's something about File Extensions

Post by Ambush Commander »

Is it just me, or is there like this unspoken rule in Linux that says thou shalt not use file extensions? Just wondering. A lot of txt files don't have file extensions. It's been baffling me ever since I installed Mandrake Linux on a laptop.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

in unix there no such thing as extensions.. there are only filenames.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Then how do you tell what a file is?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Windows nor Macs require an extension either. They are mostly there for convienance. The file's data itself determines what the file is.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Oh... that's interesting. So if you get a mystery file, what do you do with it?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

i was thinking about the dos days.... filename (8) + extension (3)

anyway, "man file" will give you some clear hints on how to discover the "type" of a file....
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Awesome. Thanks. Is it a good idea to add file extensions?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

extensions help Windows determine which application to launch by default. They help most applications find the files they normally deal with.. other than that, it doesn't matter too much.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

There is no problem using file extensions in Linux. It's up to you. If you use a shell like Bash with colors enabled, when you do an ls in a directory, binaries (executables) will show up green, symlinks aqua, directories blue etc etc. Some people choose to name binaries with a .bin, and you can use anything you want really. In Linux though, it is easy to tell by the directory you are in, for instance, you can bet everything in /usr/bin is a binary, or everything in /etc is a text file / script. In your home directory, it is up to you.
Post Reply