xref: /freebsd/contrib/file/magic/Magdir/commands (revision e949ce9dc0e6fff26e83904f1008b76d36ba0a37)
1
2#------------------------------------------------------------------------------
3# $File: commands,v 1.82 2026/02/16 14:39:53 christos Exp $
4# commands:  file(1) magic for various shells and interpreters
5#
6#0	string/w	:			shell archive or script for antique kernel text
70	string/fwt	#!\ /bin/sh		POSIX shell script text executable
8!:mime	text/x-shellscript
90	string/fwb	#!\ /bin/sh		POSIX shell script executable (binary data)
10!:mime	text/x-shellscript
11>10	string	#\040This\040script\040was\040generated\040using\040Makeself	\b, self-executable archive
12>>53	string	x	\b, Makeself %s
13
140	string/fwt	#!\ /bin/csh		C shell script text executable
15!:mime	text/x-shellscript
16
17# korn shell magic, sent by George Wu, gwu@clyde.att.com
180	string/fwt	#!\ /bin/ksh		Korn shell script text executable
19!:mime	text/x-shellscript
200	string/fwb	#!\ /bin/ksh		Korn shell script executable (binary data)
21!:mime	text/x-shellscript
22
230	string/fwt	#!\ /bin/tcsh		Tenex C shell script text executable
24!:mime	text/x-shellscript
250	string/fwt	#!\ /usr/bin/tcsh	Tenex C shell script text executable
26!:mime	text/x-shellscript
270	string/fwt	#!\ /usr/local/tcsh	Tenex C shell script text executable
28!:mime	text/x-shellscript
290	string/fwt	#!\ /usr/local/bin/tcsh Tenex C shell script text executable
30!:mime	text/x-shellscript
31
32#
33# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
340	string/fwt	#!\ /bin/zsh		Paul Falstad's zsh script text executable
35!:mime	text/x-shellscript
360	string/fwt	#!\ /usr/bin/zsh	Paul Falstad's zsh script text executable
37!:mime	text/x-shellscript
380	string/fwt	#!\ /usr/local/bin/zsh	Paul Falstad's zsh script text executable
39!:mime	text/x-shellscript
400	string/fwt	#!\ /usr/bin/env\ zsh	Paul Falstad's zsh script text executable
41!:mime	text/x-shellscript
42
430	string/fwt	#!\ /bin/ash		Neil Brown's ash script text executable
44!:mime	text/x-shellscript
450	string/fwt	#!\ /usr/bin/ash	Neil Brown's ash script text executable
46!:mime	text/x-shellscript
470	string/fwt	#!\ /usr/local/bin/ash	Neil Brown's ash script text executable
48!:mime	text/x-shellscript
490	string/fwt	#!\ /usr/local/bin/ae	Neil Brown's ae script text executable
50!:mime	text/x-shellscript
510	string/fwt	#!\ /bin/nawk		new awk script text executable
52!:mime	text/x-nawk
530	string/fwt	#!\ /usr/bin/nawk	new awk script text executable
54!:mime	text/x-nawk
550	string/fwt	#!\ /usr/local/bin/nawk new awk script text executable
56!:mime	text/x-nawk
570	string/fwt	#!\ /bin/gawk		GNU awk script text executable
58!:mime	text/x-gawk
590	string/wt	#!\ /usr/bin/gawk	GNU awk script text executable
60!:mime	text/x-gawk
610	string/fwt	#!\ /usr/local/bin/gawk GNU awk script text executable
62!:mime	text/x-gawk
63#
640	string/fwt	#!\ /bin/awk		awk script text executable
65!:mime	text/x-awk
660	string/fwt	#!\ /usr/bin/awk	awk script text executable
67!:mime	text/x-awk
680	regex/4096	=^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{]	awk or perl script text
69
700	string/fwt	#!\ /bin/lua		Lua script text executable
71!:mime	text/x-lua
720	string/fwt	#!\ /usr/bin/lua	Lua script text executable
73!:mime	text/x-lua
740	string/fwt	#!\ /usr/bin/env\ lua	Lua script text executable
75!:mime	text/x-lua
760	string/fwt	#!\ /bin/env\ lua	Lua script text executable
77!:mime	text/x-lua
78
79# AT&T Bell Labs' Plan 9 shell
800	string/fwt	#!\ /bin/rc	Plan 9 rc shell script text executable
81
82# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
830	string/fwt	#!\ /bin/bash	Bourne-Again shell script text executable
84!:mime	text/x-shellscript
850	string/fwb	#!\ /bin/bash	Bourne-Again shell script executable (binary data)
86!:mime	text/x-shellscript
870	string/fwt	#!\ /usr/bin/bash	Bourne-Again shell script text executable
88!:mime	text/x-shellscript
890	string/fwb	#!\ /usr/bin/bash	Bourne-Again shell script executable (binary data)
90!:mime	text/x-shellscript
910	string/fwt	#!\ /usr/local/bash	Bourne-Again shell script text executable
92!:mime	text/x-shellscript
930	string/fwb	#!\ /usr/local/bash	Bourne-Again shell script executable (binary data)
94!:mime	text/x-shellscript
950	string/fwt	#!\ /usr/local/bin/bash Bourne-Again shell script text executable
96!:mime	text/x-shellscript
970	string/fwb	#!\ /usr/local/bin/bash Bourne-Again shell script executable (binary data)
98!:mime	text/x-shellscript
990	string/fwt	#!\ /usr/bin/env\ bash	Bourne-Again shell script text executable
100!:mime	text/x-shellscript
1010	string/fwt	#!\ /bin/env\ bash	Bourne-Again shell script text executable
102!:mime	text/x-shellscript
103
1040	string/fwt	#!\ /bin/dash	Dash shell script text executable
105!:mime	text/x-shellscript
1060	string/fwt	#!\ /usr/bin/dash	Dash shell script text executable
107!:mime	text/x-shellscript
108
109# Fish shell magic
110# From: Benjamin Lowry <ben@ben.gmbh>
1110	string/fwt	#!\ /usr/local/bin/fish		fish shell script text executable
112!:mime	text/x-shellscript
1130	string/fwt	#!\ /usr/bin/fish		fish shell script text executable
114!:mime	text/x-shellscript
1150	string/fwt	#!\ /usr/bin/env\ fish		fish shell script text executable
116!:mime	text/x-shellscript
117
1180	search/1/fwt	#!\ /usr/bin/tclsh	Tcl/Tk script text executable
119!:mime	text/x-tcl
120
1210	search/1/fwt	#!\ /usr/bin/texlua	LuaTex script text executable
122!:mime	text/x-luatex
1230	search/1/fwt	#!\ /usr/bin/env\ texlua	LuaTex script text executable
124!:mime	text/x-luatex
1250	search/1/fwt	#!\ /bin/env\ texlua	LuaTex script text executable
126!:mime	text/x-luatex
127
1280	search/1/fwt	#!\ /usr/bin/luatex	LuaTex script text executable
129!:mime	text/x-luatex
130
1310	search/1/fwt	#!\ /usr/bin/stap	Systemtap script text executable
132!:mime	text/x-systemtap
1330	search/1/fwt	#!\ /sbin/openrc-run	OpenRC script text executable
134!:mime	text/x-shellscript
135
136# From: Marc Chantreux <mc@unistra.fr>
137# [Raku](https://raku.org/) script
1380	string/fwt	#!\ /bin/raku		Raku (http://raku.org) script
139!:mime	text/x-raku
1400	string/fwt	#!\ /usr/bin/raku	Raku (http://raku.org) script
141!:mime	text/x-raku
142
143# From: Kylie McClain <kylie@somas.is>
144# Type: execline scripts
145# URL:	https://skarnet.org/software/execline/
1460	string/fwt	#!\ /command/execlineb		execline script text executable
147!:mime	text/x-execline
1480	string/fwt	#!\ /bin/execlineb		execline script text executable
149!:mime	text/x-execline
1500	string/fwt	#!\ /usr/bin/execlineb		execline script text executable
151!:mime	text/x-execline
1520	string/fwt	#!\ /usr/bin/env\ execlineb		execline script text executable
153!:mime	text/x-execline
154
1550	string	#!
156>0	regex	\^#!.*/bin/execlineb([[:space:]].*)*$	execline script text executable
157!:mime	text/x-execline
158
1590	string	#!/nix/store/
160>&-11	string/T	x			a %s script text executable
161
162# PHP scripts
163# Ulf Harnhammar <ulfh@update.uu.se>
1640	search/1/c	=<?php			PHP script text
165!:strength + 55
166!:mime	text/x-php
1670	search/1	=<?\n			PHP script text
168!:mime	text/x-php
1690	search/1	=<?\r			PHP script text
170!:mime	text/x-php
1710	search/1/w	#!\ /usr/local/bin/php	PHP script text executable
172!:strength + 55
173!:mime	text/x-php
1740	search/1/w	#!\ /usr/bin/php	PHP script text executable
175!:strength + 55
176!:mime	text/x-php
177# Smarty compiled template, https://www.smarty.net/
178# Elan Ruusamae <glen@delfi.ee>
1790	string	=<?php
180>5	regex	[\ \n]
181>>6	string	/*\ Smarty\ version		Smarty compiled template
182>>>24	regex	[0-9.]+				\b, version %s
183!:mime	text/x-php
184
1850	string		Zend\x00		PHP script Zend Optimizer data
186
187# From: Anatol Belski <ab@php.net>
1880	string		OPCACHE
189>7	ubyte		0			PHP opcache filecache data
190
1910	search/64	--TEST--
192>16	search/64	--FILE--
193>24	search/8192	--EXPECT		PHP core test
194!:ext	phpt
195
196# https://www.php.net/manual/en/phar.fileformat.signature.php
197-4	string		GBMB			PHP phar archive
198>-8	ubyte		0x1			with MD5 signature
199!:ext	phar
200>-8	ubyte		0x2			with SHA1 signature
201!:ext	phar
202>-8	ubyte		0x3			with SHA256 signature
203!:ext	phar
204>-8	ubyte		0x4			with SHA512 signature
205!:ext	phar
206>-8	ubyte		0x10			with OpenSSL signature
207!:ext	phar
208>-8	ubyte		0x11			with OpenSSL SHA256 signature
209!:ext	phar
210>-8	ubyte		0x12			with OpenSSL SHA512 signature
211!:ext	phar
212
2130	string/t	$!			DCL command file
214
215# Type: Pdmenu
216# URL:	https://packages.debian.org/pdmenu
217# From: Edward Betts <edward@debian.org>
2180	string		#!/usr/bin/pdmenu	Pdmenu configuration file text
219
220# From Danny Weldon
2210	string	\x0b\x13\x08\x00
222>0x04	uleshort	<4	ksh byte-code version %d
223
224# From: arno <arenevier@fdn.fr>
225# mozilla xpconnect typelib
226# see https://www.mozilla.org/scriptable/typelib_file.html
2270	string		XPCOM\nTypeLib\r\n\032		XPConnect Typelib
228>0x10  byte	   x	   version %d
229>>0x11 byte	   x	  \b.%d
230
2310	string/fwt	#!\ /usr/bin/env\ runghc	GHC script executable
2320	string/fwt	#!\ /usr/bin/env\ runhaskell	Haskell script executable
2330	string/fwt	#!\ /usr/bin/env\ julia Julia script executable
234