FS utils treates directories as files?

Thomas Backman serenity at exscape.org
Tue Jun 9 07:05:33 UTC 2009


FreeBSD 8.0-CURRENT r193521 (Jun 5), bash:
[root at chaos /usr/ports]# file /
/: directory
[root at chaos /usr/ports]# cat /
�g��=[root at chaos /usr/ports]#
[root at chaos /usr/ports]# cat /usr/ports/mail
�
�
��9���Makefile�@abook�@adcomplain2�@althea�@addresses- 
goodies=�@annoyance-filterF�@anomy-sanitizerN�@antivirus- 
milterX�@anubisf�@archivemailm�@[root at chaos /usr/ports]#

Mac OS X 10.5, bash:
serenity at macbookpro ~ $ cat /
cat: /: Is a directory

Linux, bash:
(21:34) serenity at exscape ~ $ cat /
cat: /: Is a directory

The same applies to most FS utilities. Is this a feature or not? I  
find it pretty darn weird.

[root at chaos /usr/ports]# cat /etc
�_�=    syslog.conf
[root at chaos /usr/ports]# less /etc
/etc is a directory
[root at chaos /usr/ports]# more /etc
^ 
C 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@< 
80 
 > 
_ 
^ 
R 
< 
EA 
 > 
= 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@       
^ 
E 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^@^@^@^@^@^@syslog.conf^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
[root at chaos /usr/ports]# grep syslog /etc
Binary file /etc matches
[root at chaos /usr/ports]# tail /etc
�_�=    syslog.conf
[root at chaos /usr/ports]# head /etc
�_�=    syslog.conf
[root at chaos /usr/ports]#

Regards,
Thomas


More information about the freebsd-current mailing list