Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Running the command:

file run.sh

Gives me:

run.sh: Bourne shell script text executable

in Linux. Is there an equivalent command in Windows?

share|improve this question

migrated from stackoverflow.com Apr 18 '11 at 14:16

This question came from our site for professional and enthusiast programmers.

2  
This is a QA forum. Not Google. You should try searching before just asking people here. - gnuwin32.sourceforge.net/packages/file.htm –  Noufal Ibrahim Apr 18 '11 at 8:32
4  
@Noufal: No, you shouldn't. Q&A means that you ask questions. This is a question. Q&A doesn't imply anything about searching first. –  Cody Gray Apr 18 '11 at 8:33
    
Cody: Arguably. I still think some research before firing off a question is a good thing. –  Noufal Ibrahim Apr 18 '11 at 8:35
3  
Sorry people, but i tried google and then I asked this question here. –  Abhishek Simon Apr 18 '11 at 8:39
1  
The file command is not part of the Linux kernel per say. It's a package that's installed on most distributions by default. Windows doesn't have something like this. Most decisions there are taken based on file extensions rather that content. –  Noufal Ibrahim Apr 18 '11 at 10:17
show 2 more comments

4 Answers 4

up vote 2 down vote accepted

There probably isn't one on your system by default. You could install the Cygwin tools suite (ports of GNU commands to the Win32 APIs). There used to also be the MKS Toolkit and another one whose name escapes me at the moment. MKS was commercial, Cygwin, of course was GNU/GPL, and the other won was eventually renamed (from OpenNT?) and later acquired by Microsoft and incorporated into some sort of MSDN suite for Win2K or Server 2003 or something like that.

For any of those you'd just run the 'file' command on your target files just as you would under UNIX. You might have to start them under the included UNIX-like shell (bash, for Cygwin, ksh or MKS Toolkit, and who knows what for the other one).

share|improve this answer
    
Hey thanks for the info, I heard about MKS too and worked on Cygwin, but then again I was wondering whether there is a tool that comes by default in windows. Thanks anyways :) –  Abhishek Simon Apr 18 '11 at 9:05
add comment

As others have said, there's nothing built into Windows. If you'd like an alternative to the file ports, check out TrID. The developer also makes the analyzer available as both a Win32 DLL or a .NET Assembly.

share|improve this answer
    
very nice. there is even an "online" scanner available that small files can be uploaded to. mark0.net/onlinetrid.aspx –  user26398 Feb 11 '12 at 4:39
add comment

Not built-in; Windows uses file-extensions to determine file-type. I'm pretty sure that there's a port of file in Cygwin, though.

share|improve this answer
    
@nickgrim:,@skwllsp: I needed something that comes by default in every windows system. –  Abhishek Simon Apr 18 '11 at 8:52
    
@nickgrim: This might be it, because windows uses file-extensions to determine file-type, so there is no built it command. If I happen to find a solution i'll post it here. Thanks all for your efforts :) –  Abhishek Simon Apr 18 '11 at 9:08
add comment

Take a look at File.exe - a small program similar to the Unix / Linux file executable which can examine files, in this case it is designed to query an executable file and display the processor that the file was compiled to run on and any other details it can report on.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.