Find the answer to your Linux question:
Results 1 to 4 of 4
In windows, if I change the file extension, Windows cannot open the file. But in Linux, if I change the file extension, Linux can still open it. Why ?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5

    Question How Linux knows the right application to open a file ?


    In windows, if I change the file extension, Windows cannot open the file. But in Linux, if I change the file extension, Linux can still open it. Why ?

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    It's a complicated subject. Since the Graphical User Interface is not
    built in to Linux, you can get systems that have Gnome, KDE, or some
    other desktop. In Gnome you associate files with apps by configuring
    the nautilus file manager (I think). From the command line, file extensions
    are irrelevant.

  3. #3
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    But Nautilus can open unconfigured files without extension. For example, I removed the extension of a PNG file and copied it into another Linux computer. File can be still opened.

  4. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    36
    Advanced file managers like nautilus do not rely on file extension only for file association. Every file has some information in it about its mime-type. You can reveal it using "file" command in shell. For example:
    Code:
    file filename.mp4
    Output:
    filename.mp4: ISO Media, MPEG v4 system, version 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •