Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How does linux recognize file types? Post 302530782 by Skrynesaver on Wednesday 15th of June 2011 03:25:15 AM
Old 06-15-2011
There is a program called file which uses a database of "magic numbers" ( /usr/share/magic) to determine the content-type of a file.
This User Gave Thanks to Skrynesaver For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can I force my Linux RedHat to recognize my modem??

yeah, I tried basically everything I can find from reading books and asking people but I haven't gotten it to work. is there anything else that can be done. I mean, this internal modem I got is like the last thing I expected Linux not to find (2 Replies)
Discussion started by: TRUEST
2 Replies

2. UNIX for Dummies Questions & Answers

So many types of LINUX's!

I installed Redhat into my system. The reason? This was the version my friend was running and he told me about this one, so I downloaded and installed it. Simple enough :D But as I am searching the net, I am coming across many other forms of linux made by other companies. Redhat seems to be... (2 Replies)
Discussion started by: Minnesota Red
2 Replies

3. Filesystems, Disks and Memory

associated file types

I have a file of type .for extension .In a guui based unix environment like solaris if I double click on that file a specific program designed by me has to run which takes this file as the parameter and exceutes the program. Can anyone help me? (8 Replies)
Discussion started by: nhk_srd
8 Replies

4. Shell Programming and Scripting

How to recognize if a file still opened by any process?

Is there a way to tell for sure if a file currently is opened by any running process? I have a task to filter a text file which is produced by some long process. I have no way to communicate with that process, but I have access to a location, where that proces produce an output file. Need... (3 Replies)
Discussion started by: alex_5161
3 Replies

5. Red Hat

newbie: Linux Server Names & Types..!!!

Any one tell me about the list of Redhat Linux Enterprise 5 SERVERS and their functions. thanks (3 Replies)
Discussion started by: salman103
3 Replies

6. UNIX for Dummies Questions & Answers

How to find the partition types in linux

How do we find the partition type in Linux? df -T will give me the mounted partition types like ufs, ext3 etc. How do I find out for say a newly added disk to the system? Please advise... Thanks (2 Replies)
Discussion started by: lubu
2 Replies

7. Red Hat

Copy certain file types recursively while maintaining file structure on destination?

Hi guys, I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash. I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also... (1 Reply)
Discussion started by: rockf1bull
1 Replies

8. Shell Programming and Scripting

Cp -r except certain file types

the following excludes certain directories successfully cp -r probe/!(dir) /destination I want to exclude certain file types and tried unsuccessfully cp -r probe/!(*.avi) /destination (2 Replies)
Discussion started by: tmf
2 Replies

9. Windows & DOS: Issues & Discussions

Convert UNIX text file in Windows to recognize line breaks

Hmmm I think I found the correct subforum to ask my question... I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this?... (1 Reply)
Discussion started by: frys_hp
1 Replies

10. UNIX for Dummies Questions & Answers

Convert UNIX text file in Windows to recognize line breaks

Hi all, I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this? Or just reinsert thousands of line breaks again :eek: ? (2 Replies)
Discussion started by: frys_hp
2 Replies
FSTYP(8)						    BSD System Manager's Manual 						  FSTYP(8)

NAME
fstyp -- determine filesystem type SYNOPSIS
fstyp [-l] [-s] special DESCRIPTION
The fstyp utility is used to determine the filesystem type on a given device. It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS filesys- tems. The filesystem name is printed to the standard output as, respectively, cd9660, ext2fs, msdosfs, ntfs, or ufs. Because fstyp is built specifically to detect filesystem types, it differs from file(1) in several ways. The output is machine-parsable, filesystem labels are supported, the utility runs sandboxed using capsicum(4), and does not try to recognize any file format other than filesystems. These options are available: -l In addition to filesystem type, print filesystem label if available. -s Ignore file type. By default, fstyp only works on regular files and disk-like device nodes. Trying to read other file types might have unexpected consequences or hang indefinitely. EXIT STATUS
The fstyp utility exits 0 on success, and >0 if an error occurs or the filesystem type is not recognized. SEE ALSO
file(1), capsicum(4), glabel(8), mount(8) HISTORY
The fstyp command appeared in FreeBSD 11.0. AUTHORS
The fstyp utility was developed by Edward Tomasz Napierala <trasz@FreeBSD.org> under sponsorship from the FreeBSD Foundation. BSD
January 14, 2015 BSD
All times are GMT -4. The time now is 07:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy