Changing information supplied when running file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing information supplied when running file
# 1  
Old 05-07-2015
Changing information supplied when running file

In unix systems I can call `file` to return me the file type.

Code:
file cel.vik
$ cel.vik: ASCII text

How can I append additional information when I create a file such that when I call `file` it returns me that additional information.
# 2  
Old 05-07-2015
man file:
Quote:
-i, --mime
Causes the file command to output mime type strings rather than the more traditional human readable ones. Thus it may say ‘text/plain; charset=us-ascii’ rather
than “ASCII text”.
Or you can create your own "magic" file (c.f. man file).
# 3  
Old 05-07-2015
I really need an example. Let's say I want to include "vik-codex" when I do `file cel.vik`. Do I need to do something when I create the file or can I append the information any time I want?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

CHFS running clean but FileSize not changing

sapep101dr(root):/home/root>lsvg -l vg00 vg00: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT lv_102_64 jfs2 40 40 1 open/syncd /oracle/EP1/102_64 loglv01 jfs2log 1 1 1 open/syncd N/A lv_EP1 ... (4 Replies)
Discussion started by: nck_ptl
4 Replies

2. Shell Programming and Scripting

Need to get all the records from a log file greater than timestamp supplied.

I have a log file which has records with hung thread information/error I need to find out hung thread from log file greater than timestamp supplied. 00000026 ThreadMonitor W WSVR0605W: Thread "WebContainer : 1" (00000027) has been active for 701879 milliseconds and may be hung. There is/are... (6 Replies)
Discussion started by: megh
6 Replies

3. Shell Programming and Scripting

How to display information of the script while its running?

how to display the messages on screen IN PERL such as " 1. Entering while loop" if the script enters a while loop. 2. Checking FILENAME. etc... 3. Print statement is also not helpful.... (1 Reply)
Discussion started by: Rashid Khan
1 Replies

4. Programming

Checking which arguments are supplied

I have written this C++ program and I am using getopt_long and want to chech when the user supplies the arguments so that I can put a default or otherwise. Currently I am using hasargv or Pc.get_string("key",s), Pc.get_real("key",s), etc to detect whether the user supplied a value. For... (3 Replies)
Discussion started by: kristinu
3 Replies

5. Programming

Checking which arguments are supplied

I have written this C++ program and I am using getopt_long (2 Replies)
Discussion started by: kristinu
2 Replies

6. Programming

Checking which arguments are supplied

I have written this C++ program and I am using getopt_long and (0 Replies)
Discussion started by: kristinu
0 Replies

7. UNIX for Dummies Questions & Answers

Display full command (including options) information in running

Suppose I am a Unix user, not a root. I can see all commands in running by ps -elf, or some similar commands. Such commands may be submit by other Unix users. Is there a way that I can display those commands with their full parameters/options. For example, I can see a user is running "ls"... (3 Replies)
Discussion started by: happy_lotus
3 Replies

8. UNIX for Dummies Questions & Answers

Delete from supplied list of files

Hi, I have a file that contains >4000 inode numbers. Each inode number is on separate row. I'd like to delete all this files. Any idea how could I do it? Thank you. Andrej (3 Replies)
Discussion started by: andrejm
3 Replies

9. UNIX for Dummies Questions & Answers

Changing email header information by tweaking sendmail

How can i tweak sendmail configuration files so that the "Received:" field is removed from email header information? Or else can i change Received: (from enswitch@localhost) in email header to something likeReceived: (from xyz@localhost)? ---------- Post updated at 09:57 PM ---------- Previous... (2 Replies)
Discussion started by: proactiveaditya
2 Replies
Login or Register to Ask a Question