file <filename> fails


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users file <filename> fails
# 1  
Old 08-14-2006
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  
Old 08-14-2006
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  
Old 08-14-2006
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Extraction of .gz file using 7zip fails

Hi, My target is to send a file created by Unix process to myself as an excel file. So I have used the below commands to achieve it. tr -d '\t' < PROGRAM_CREATED_FILE | sed -e 's/\\//g' | awk 'BEGIN{FS=">"; OFS="\t"} '{$1=$1}1' > file.xls gzip -9 file.xls echo "test mail" | sendxchange -a... (3 Replies)
Discussion started by: PikK45
3 Replies

2. Shell Programming and Scripting

Bash script fails when run as file

The following bash script fails with error message: "./phpquery_KNBB_html_reader.sh: line 65: syntax error near unexpected token `done'" when do ./<scriptname> in the shell. However when I copy-paste the entire contents of the file directly into a shell environment it runs ok returning the intended... (2 Replies)
Discussion started by: BurritoSolution
2 Replies

3. Shell Programming and Scripting

Windows exe file fails when triggered from ssh

Hi, I am triggering a windows exe file using the below command. ssh user@remoteserver command.exe -option1:xx /option2:yy This command is working fine from windows command prompt. When I am triggering the same command from ssh I get the error message cant load Any ideas to deal with... (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies

4. Shell Programming and Scripting

SFTP Script fails to transmit the file

I have written a Unix Script to automate the process of File transfer from Our server to vendor Server but the automation Script fail when Progress meter is around 65-70% Complete. Why is this haapening? See the Log File Contenet: spawn sftp -o IdentityFile=/home/lawsched/ah_rsa XXX@YYY.com... (10 Replies)
Discussion started by: Mahesh Gajapath
10 Replies

5. UNIX for Dummies Questions & Answers

Replacing char in filename scripts fails

Hi I'm trying to remove what I "think" is a bad character. How I got the bad character is when I downloaded jpgs onto my PC and then renamed the files using windows explorer. In cygwin, the files look like $ dir -l total 7840 ----------+ 1 None 3647968 Jul 21 08:41 2012-07-21\ (1).JPG... (6 Replies)
Discussion started by: SailingDreams
6 Replies

6. Shell Programming and Scripting

echoing complex awk command into file fails

Using hp-ux's shell, I'm trying to echo a complex awk command into a script file for later use. But it fails on a newline character and splits the rest of the command onto the next line. echo ' printf("%s: TOTAL = %18.0lf\n", FILENAME, TOTAL) >> "TOTAL.TXT";' >>awk.script Looks... (3 Replies)
Discussion started by: Scottie1954
3 Replies

7. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

8. AIX

mkdvd mkcd mksysb from file fails

Hello Folks,Having some problems moving an old mksysb backup to a file image.data to DVD-RAM1) From mkdvd if i do a new backup it works fineBUT2) From mkdvd if I do fails:+--------------------------------------------------------------------------+| Use an existing mksysb image?... (8 Replies)
Discussion started by: filosophizer
8 Replies

9. Shell Programming and Scripting

log file when the script fails !

i have a script that will retrive some info from database. The script is working fine but i have to add new feature in it when the script fails or retrive null result it should reflect in the log file. below the script AMR_Inactive.sh while read i do connect1=`sqlplus -silent... (3 Replies)
Discussion started by: ali560045
3 Replies

10. Solaris

Created cron.allow file and now email fails

Getting ready for Sarbanes Oxley and I was told that I need to create a cron.allow file for the box so that only specified users can create cron jobs. That was easy enough, and I put in all the accounts that had scheduled cron jobs such as: root lp My oracle account A couple of programmer... (1 Reply)
Discussion started by: citrowske
1 Replies
Login or Register to Ask a Question