FILE(1) General Commands Manual FILE(1)NAME
file - determine file type
SYNOPSIS
file file ...
DESCRIPTION
File performs a series of tests on each argument in an attempt to classify it. If an argument appears to be ascii, file examines the first
512 bytes and tries to guess its language.
BUGS
It often makes mistakes. In particular it often suggests that command files are C programs.
Does not recognize Pascal or LISP.
7th Edition April 29, 1985 FILE(1)
Check Out this Related Man Page
file(1) General Commands Manual file(1)Name
file - determine file type
Syntax
file [ -c ] [ -f ffile] [ -m mfile] filename ...
Description
The command performs a series of tests on each filename argument in an attempt to classify it. If an argument appears to be ASCII, the
command examines the first 1024 bytes and tries to guess its language.
For character special files, part of this classification is information about which devices the system shows as active. In particular,
device-specific information such as controller type and unit, device type and unit, and status (offline, write locked, density, errors) is
returned. The general categories currently implemented are disk, tape, and terminal devices. The supported terminal devices include Local
Area Terminals (LAT) but not Local Area Network (LAN) pseudo-terminals.
The command uses the file to identify files that have some sort of magic number. A magic number is any numeric or string constant that
identifies the file containing the constant. Commentary at the beginning of explains its format.
Options-c Checks the magic file for format errors by printing the internal representation of the magic file. No file typing is done under -c.
-f Interprets the following argument to be a file containing the names of the files to be examined.
-m Instructs file to use an alternate magic file.
Restrictions
It often does a poor job of distinguishing C programs, shell scripts, English text, and ASCII text.
It does not recognize many programming languages, including Modula, Pascal, and Lisp.
Files
/usr/lib/file/magic
See Alsomagic(5)file(1)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)