The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to add filename to the end of each line in file tmikahan Shell Programming and Scripting 2 05-08-2007 05:24 AM
validation :file <filename> u263066 Shell Programming and Scripting 2 09-26-2006 03:59 AM
Created cron.allow file and now email fails citrowske SUN Solaris 1 09-14-2006 09:32 AM
insert filename into file using SED (or AWK) USER#5 Shell Programming and Scripting 2 08-06-2006 10:08 PM
help on deleting file/filename apalex UNIX for Dummies Questions & Answers 4 06-27-2001 09:31 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-14-2006
kingskar kingskar is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 21
file <filename> fails

Hi Friends

I tried to find the file type of a file on my linux machine by using the following command

file xy.txt

instead of getting the file type i got following message

file: couldnot found any magic files!

What is wrong on this
how can i find the file type?

Regards
Shekar
  #2 (permalink)  
Old 08-14-2006
apoorvasharma80 apoorvasharma80 is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 69
Let's get into something deep, how this file program is working. Every file has got some information of it's type into few starting bytes. Those bytes are known as magic numbers. Your file program will look into this number and try to resolve the file type. You can see the same by using 'od'.
Now as far as your porblem is concern may be there is a file which stores the information about this magic numbers and that file seems to be removed from your system. ( I am not very sure about this, as most of the implemetations of file have this info in the source code).

regards
Apoorva Kumar
  #3 (permalink)  
Old 08-14-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
check whether the magic file is available under
/usr/lib/locale/LC_MESSAGES/LC_MESSAGES/

as

a magic file as /usr/lib/locale/locale/LC_MESSAGES/magic

or under /etc/magic

else try to execute the file command as

file -m <magicfile_location> <filename>

try using either of the files
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0