file command sees regular ASCII text file as ASCII Java program text
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
file command sees regular ASCII text file as ASCII Java program text
I need some assistance. I have regular ASCII text documents. If any of those documents have the word "import" in it, the file command sees it as ASCII Java program text. If these same files do not have that word in it, they are seen as ASCII text. This causes a problem with what we are doing. The text documents recognized as ASCII Java program get blocked. Does anyone know if there is some kind of linux update or bug or something??? Point me on where or how to search Google for something for help?
It is called "magic". You can instruct "file" command to ommit some tests. "file" command do the best to guess file type, for example looking inside file for searching some pattern which could reveal its type. If you do not want this behavior you can exclude some tests by adding "-e" option, for example
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.