Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

file(1) [minix man page]

FILE(1) 						      General Commands Manual							   FILE(1)

file - make a guess as to a file's type based on contents SYNOPSIS
file name ... EXAMPLES
file a.out ar.h # Guess at types DESCRIPTION
File reads the first block of a file and tries to make an intelligent guess about what kind of file it is. It understands about archives, C source programs, executable binaries, shell scripts, and English text. FILE(1)

Check Out this Related Man Page

FILE(1) 						      General Commands Manual							   FILE(1)

file - determine file type SYNOPSIS
file [ file ... ] DESCRIPTION
File performs a series of tests on its argument files in an attempt to classify their contents by language or purpose. If no arguments are given, the classification is performed on standard input. The file types it looks for include directory, device file, zero-filled file, empty file, Plan 9 executable, PAC audio file, cpio archive, tex dvi file, archive symbol table, archive, rc script, sh script, PostScript, troff output file for various devices, GIF, FAX, pic- file(9.6), object code, C and Alef source, assembler source, compressed files, encrypted file, English text, Plan 9 bitmap, Plan 9 subfont, Plan 9 font. If a file has no apparent format, file looks at the character set it uses to classify it according to ASCII, extended ASCII, Latin ASCII, or UTF holding one or more of the following blocks of the Unicode Standard: Extended Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Lao, Tibetan, Georgian, Japanese, Chinese, or Korean. If all else fails, file decides its input is binary. SOURCE
/sys/src/cmd/file.c BUGS
It can make mistakes, for example classifying a file of decimal data, etc. as troff(1) input. FILE(1)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File/directory information......

Basically i have done created the script below, and it functions ok, it prints the access rights the user has. But i need it to print the group permissions, and other permissions, it would also be helpful if i could print the permissions in numeric form aswell, if it is possible. I have looked in... (50 Replies)
Discussion started by: Makaveli.2003
50 Replies

2. Shell Programming and Scripting

Korne Script for format file

Hi All, I am not too familiar with Korne script so I need as much help as possible on this ;) What I want to do is: from the excel file on my computer, I want to take certain field from this xls file and put it in txt or cvs format in specific width column. Then fpt this file into the server. ... (51 Replies)
Discussion started by: CamTu
51 Replies

3. Shell Programming and Scripting

Parse a string in XML file using shell script

Hi! I'm just new here and don't know much about shell scripting. I just want to ask for help in creating a shell script that will parse a string or value of the status in the xml file. Please sample xml file below. Can you please help me create a simple script to get the value of status? Also it... (46 Replies)
Discussion started by: ayhanne
46 Replies

4. Shell Programming and Scripting

Bash can't find file but tcsh can why?

I have a short script for compiling an old program. It's a simple text file 'ccprog' created in emacs. The permissions were changed with 'chmod 775 ccprog' to make it an executable. When I try to run ccprog I get "bash: ./ccprog: No such file or directory". If I change to tcsh ccprog runs. Why... (68 Replies)
Discussion started by: muddauber
68 Replies

5. UNIX for Dummies Questions & Answers

List directories, subs and files

Hi, I try to list all files in a folder, including all the subdirs (and their subdirs) and all files contained in each of these folders. I then print it to a simple txt file. I use ls -R -1 >test.txt This sort of does what I need, yet, the result is something like: It reasonably comes... (53 Replies)
Discussion started by: dakke
53 Replies

6. UNIX for Dummies Questions & Answers

Getting non unique lines from concatenated files

Hi All, Is there a way to get NON unique lines from 2 or more concatenated files? Basically I have several files which are very similar with the exception of few lines and I want to find out which lines are different in each file. Very simple example is file1 contains: 1 2 3 4 5file2... (122 Replies)
Discussion started by: pawannoel
122 Replies

7. Shell Programming and Scripting

Copy file to SD card from internal flash.

Hi, At first I have to say that I know nothing about Linux :( But I am looking for solution how to copy one file from internal Lowrnace HDS flash memory. Lowrance HDS is Linux based device. Here is the link for firmware update files for this unit. At the end of main firmware file there... (62 Replies)
Discussion started by: PouchX
62 Replies

8. Shell Programming and Scripting

Help in extracting fields from a file

I have an input file with contents like: 203969 OrdAcctCycChg USAGE_DAEMON1 203970 OrdAcctCycChg USAGE_DAEMON2 203971 OrdAcctCycChg USAGE_DAEMON3 203972 OrdAcctCycChg USAGE_DAEMON4 I need to extract variables in first column... (51 Replies)
Discussion started by: Rajesh Putnala
51 Replies

9. Shell Programming and Scripting

Help me pls : splitting single file in unix into different files based on data

I have a file in unix with sample data as follows : -------------------------------------------------------------- -------------------------------------------------------------- {30001002|XXparameter|Layout|$ I want this file to be splitted into different files and corresponding to the sample... (54 Replies)
Discussion started by: Ravindra Swan
54 Replies

10. Shell Programming and Scripting

FTP search ,grep using perl

Need assistance on a Perl script. I have a list of file names in a file and would like to search/grep the same names in the list of files on the ftp server and output to a file. Any help is appreciable Below is the script that can give me the list of files,size of file, Modified date on the... (56 Replies)
Discussion started by: ajayram_arya
56 Replies

11. UNIX for Dummies Questions & Answers

Move File Containing More Than two "-" at 3rd Line To New Directory

Hi Guys I am trying to move file containing more than two - at the 3rd line of each files to a new directory. The files are something like this : ****** Text ****** /text/ text text I want to make sure the search effect only take place on the 3rd line one as there might me... (46 Replies)
Discussion started by: Nexeu
46 Replies

12. Shell Programming and Scripting

UNIX Shell Scripting (Solaris) for File Checking

Hi guys, I'm sorry but i badly need your help. I am assigned to do a basic shell script in my job but sadly i don't have any idea on what it is because i am an electronics engineer, but i googled all of it, ask my friends but i cant finalize my scripts. so do please help me. The requirement... (47 Replies)
Discussion started by: daveaztig14
47 Replies

13. Shell Programming and Scripting

Ranking data points from multiple files

I need to rank a large number of data points that exist in multiple files. My data points (Column 3) are based on unique values in columns 1 and 2. I need to rank the values that are in File 1, Column 3. For instance: Input File 1 AAA BBB 10 CCC DDD 16 EEE FFF 20 Input File 2 ... (47 Replies)
Discussion started by: ncwxpanther
47 Replies

14. UNIX for Beginners Questions & Answers

Parsing a column of text file - best practices

HI Folks - I hope all is well! I have a business process where I manage a text file of substitution variables and their values for a target system. After updating, I run a script to push the changes to the target system. However, I'm trying to develop a method to be able to automatically... (50 Replies)
Discussion started by: SIMMS7400
50 Replies