I downloaded data in Ubuntu which has an extension .text/plain bit when I copied it to my Windows 10 through USB the file extension is changed to '.file'. What should I do now to open it?
2 Answers
It appears that Windows adds the .file
extension to any file with an extension it doesn't know/recognise. Understandable, because text/plain
is not a file extension but rather a 'content type'.
It seems that opening the file has worked on Ubuntu, because GNOME can "associate a media type with a file by examining both the filename suffix and the contents of the file" (Wikipedia).
To open the file in Windows, you can simply change the extension from .file
to .txt
, which is the most likely filetype. However, depending on where and for what purpose you downloaded the file, it could also be a .dat
(data) or other file. If you don't know how to change the file type, I'd advice to Google for it as that seems out of scope for this Ubuntu-oriented site :)
-
2Nice one. Just a pointer you can always expand/modify your answer (by clicking 'edit' below it) instead of deleting it and posting a new one :) Similarly you can 'undelete' an answer you deleted.– pomskyJan 18, 2019 at 8:00
-
3More to the point, in Windows the character
/
infilename.text/plain
is not a valid character for a filename. In Windows, filenames are not arbitrary sequences of bytes but a user-interface element with restrictions placed upon them to serve that purpose. Therefore control characters, and special shell metacharacters are not allowed. Whatever utility the poster used to copy the file has taken care of this issue.– BenJan 18, 2019 at 10:22 -
1@Ben This restriction (no
/
in filenames) also holds for Linux. AFAIR, there are only two forbidden characters in a Linux filename:/
and\0
. This means the file the OP downloaded CANNOT have an extension of.plain/text
.– PerlDuckJan 18, 2019 at 12:20
Are you 100% sure that the file extension is .text/plain
???? I'm 99% sure that it's not possible. Maybe you are talking about file content?
Can you show us the output of runing file your_filewith_strange_extension
?
To open it on Windows, it should be enough renaming its extension to something you know. Do you know what type of file it is? if you downloaded a plain text file, you can rename it to your_filewith_strange_extension.txt
. The output of running (on linux) file your_filewith_strange_extension
should give you a hint about the file contents if you don't know what it is
-
The Readme.txt within the data says that it is .json file extention. im not able to open it, and when i opened it through .txt extension i cant able to load the data since it so 450Mb size.– ammuFeb 4, 2019 at 7:25
-
@ammu if it's a json file, the content type is something like
application/json
,text/plain
or something similar, but that's not the extension of the file. The extension could be.json
,.txt
, nothing at all, anything, etc. In unix, the extension is not important (well, originally, now sometimes it does). If you need to open it in Windows and you have to guess, I'll go with.json
or.txt
as my firsts guesses– Pablo KFeb 5, 2019 at 13:07 -
1@ammu if in linux you run
head the_450mb_file.json
, what shows you? it seems like the starting of a json file? and if you runtail the_450mb_file.json
??? The idea is that you can see if it's a real json or not. The only way I could open big files on windows was with notepad++, but the last time I did it was like 10 years ago– Pablo KFeb 5, 2019 at 13:20 -
actually the content is latex file of a paper, but the extension is given as file. i cant able to load the data as .txt– ammuFeb 14, 2019 at 17:45
-
1So, to summarize: the file extension couldn't be
text/plain
, because file names can't have/
on it. Also, latex content-type isapplication/x-latex
, nottext/plain
. Maybe you have a latex file that when you open it, it shows json data? something similar to having a .docx file that when you open it with microsoft word, inside you see a json? ({key1: val1, key2: val2, (...)}
). If that's the case, you can open it with a latex editor, (latexbase.com is an online editor), if it's ok, you can rename your file to something.tex– Pablo KFeb 15, 2019 at 3:20
file filename
(where filename is the name of your file) you can view the type of file according to Ubuntu or any *nix)