Determining type of file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Determining type of file
# 1  
Old 04-20-2007
Determining type of file

Hello,

I'm attempting to modify a script so it can be executed via a batch scheduler. Part of the script calls a program called direct (which I believe may have something to do with Connect Direct). I have tried cat and vi on the file; cat returns absolute gibberish, vi states the file is executable.

I need to know the purpose of the program (it's inputs/outputs) and any parameters it requires. Short of running it (it's on a live server) is there a way of finding out what type of program it is so I can view the code?

Any help would be appreciated!
# 2  
Old 04-20-2007
i think you need the "file" command
Code:
# file myfile

check the man page of file.
# 3  
Old 04-20-2007
Thanks!

Thanks Ghostdog - exactly what I was after!

J.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

2. Linux

Determining Values for NIce and Priority items in limits.conf file

I've been looking online trying to find the correct value nice and priority can take in the limits.conf file. ON the man page it says; Does this mean priority can be any negative number and any positive? Then Does this mean any number between -20 and 19 also what does the definition of nice... (13 Replies)
Discussion started by: matthewfs
13 Replies

3. Shell Programming and Scripting

Efficient method of determining if a string is in a file.

Hi, I was hoping someone could suggest an alternative to code I currently have as mine takes up far too much processor time and it to slow. The situation: I have a programme that runs on some files just before they are zipped up and archived, the program appends a one line summary of the... (4 Replies)
Discussion started by: RECrerar
4 Replies

4. UNIX for Dummies Questions & Answers

Determining file size for a list of files with paths

Hello, I have a flat file with a list of files with the path to the file and I am attempting to calculate the filesize for each one; however xargs isn't playing nicely and I am sure there is probably a better way of doing this. What I envisioned is this: cat filename|xargs -i ls -l {} |awk... (4 Replies)
Discussion started by: joe8mofo
4 Replies

5. Programming

Determining file access perms for current process

Stupid question, but is there an ANSI C stdlib function that will do this for me? I want to pass the function a path and determine if the current process can read/write/execute on the path. I suppose I can whip something up using fstat and then determining the current process's user/group IDs and... (6 Replies)
Discussion started by: DreamWarrior
6 Replies

6. Shell Programming and Scripting

Determining position in a tab delimited file

hi, I want to determine the position of specific values over a cutoff. So I have a string of values that are mainly negative in number and I want to print the rare few that are positive. Specifically I want to know the position of the value along the string. The position is based from right to... (11 Replies)
Discussion started by: phil_heath
11 Replies

7. Shell Programming and Scripting

Problem determining file

I got the following code, it partially works. Can someone tell me why it partially doenst work? #!/bin/sh file=$1 if then echo "File is a directory" else echo "File is not a directory!" fi heres the output: philip@philip-laptop:~/Desktop$ sh exFive.sh test.java File is... (4 Replies)
Discussion started by: philmetz
4 Replies

8. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

9. UNIX for Dummies Questions & Answers

Determining file length

How can I determine what UNIX thinks the record size of any given file is?? (1 Reply)
Discussion started by: jbrubaker
1 Replies
Login or Register to Ask a Question