From owner-freebsd-questions Mon Jan 28 22:29:31 2002 Delivered-To: freebsd-questions@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 101DB37B402 for ; Mon, 28 Jan 2002 22:29:25 -0800 (PST) Received: from dialup-209.244.106.104.dial1.sanjose1.level3.net ([209.244.106.104] helo=blossom.cjclark.org) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16VRlL-0006lB-00; Mon, 28 Jan 2002 22:29:04 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id g0T6RXU32713; Mon, 28 Jan 2002 22:27:33 -0800 (PST) (envelope-from cjc) Date: Mon, 28 Jan 2002 22:27:33 -0800 From: "Crist J. Clark" To: AMI Root Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Question about cat command Message-ID: <20020128222733.E30530@blossom.cjclark.org> References: <20020129060826.17449.qmail@web9607.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020129060826.17449.qmail@web9607.mail.yahoo.com>; from amiroot@yahoo.com on Tue, Jan 29, 2002 at 02:08:26PM +0800 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Jan 29, 2002 at 02:08:26PM +0800, AMI Root wrote: > hihi all, > > I'm using FreeBSD4.4 on a P5-166 machine with 64MB > Ram. I found that I can "cat" a directory and it will > list garbage. Is it a bug or I made anything wrong??? That is expected. A "directory" is actually just a special file that contains information about the files in that directory (maps names to inodes on the disk, etc.). Progams like ls(1) treat these special files differently. cat(1) does not. It just dumps the contents of the file, this directory file, without interpreting it as anything special. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message