why does linux not seem to use file extensions?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Ah, guess I'm a little thick. What does colorls actually do? Install a new version of ls?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Nothinman
Ah, guess I'm a little thick. What does colorls actually do? Install a new version of ls?

From the package description:
This is a simple hack, taken from FreeBSD, to OpenBSD's ls(1) to
use ANSI sequences to display file attributes in color. There is
a -G flag (somewhat similar to the -F flag). Take a look at the
man page for details. The program is called "colorls", so you may
want to use an alias such as ls=${PREFIX}/bin/colorls.

Note that you need a color-capable terminal to enable colorls. This
means you should set your TERM to "wsvt25" on the wscons(4) console
and to "xterm-xfree86" when using normal xterm, not "vt220" and
"xterm", respectively, which are not color-capable in termcap(5).
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: Nothinman
How do Linux Desktop Environments handle file associations, i.e. I double-click on a JPEG file and my picture editor opens?

By default jpgs are associated with just a viewer I believe, but the general idea is right. I don't know about Konquerer, but Nautilus will get the file-type right even if the extension is wrong or missing because it actually looks at the file's contents to figure out what type of file it is. Yes, it slows down directory listings a bit but IMO it's worth it and if you have a fast enough drive it's hardly noticable.
Konqueror's pretty good too. The other day I took a peak into firefox's cache, which was just a bunch of completely random file names. But all the icons showed a preview of each item, whether it was an html page (preview was rendered, not text), an image or something text-based like css or js. Hovering over most of them gave a much bigger picture. On windows it'd be totally impossible to figure out what each file was without some trial and error (at least with just explorer).
 

TGS

Golden Member
May 3, 2005
1,849
0
0
The best reason is (ok bare with me) renamed executables. From the windows world laced emails with the jpeg payload, which is really a backdoor executable but for some reason people trust the extensions anyways.

If only windows was a little smarter about it, we wouldn't have so many email problems...


On the color issue, it's easier to find directories rather than checking on the far left on an ls -al. You could always do an alias for ls to be ls -al anyways, but color is easier without. I'm lazy so ls with color is nice. ;)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: TGS
The best reason is (ok bare with me) renamed executables. From the windows world laced emails with the jpeg payload, which is really a backdoor executable but for some reason people trust the extensions anyways.

If only windows was a little smarter about it, we wouldn't have so many email problems...


On the color issue, it's easier to find directories rather than checking on the far left on an ls -al. You could always do an alias for ls to be ls -al anyways, but color is easier without. I'm lazy so ls with color is nice. ;)

ls -F solves the "find directories quickly" issue without forcing you to see too much information or colors that are hard to read. ;) I'm lazy, I like things easy. -F also works EVERYWHERE, where as color is a bit more selective. :D