From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 01:42:37 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 547DD16A4B3 for ; Thu, 18 Sep 2003 01:42:37 -0700 (PDT) Received: from sally.edelkey.net (sally.edelkey.net [213.138.147.136]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5A0343FE0 for ; Thu, 18 Sep 2003 01:42:35 -0700 (PDT) (envelope-from mikael.karlsson@hel.fi) Received: from stadi-fsin (213138134154.edelkey.net [213.138.134.154]) by sally.edelkey.net (8.12.9/8.12.9) with SMTP id h8I8gXGk004959 for ; Thu, 18 Sep 2003 11:42:34 +0300 Received: from [137.163.173.140]:43210 (EHLO ema.hel.fi) Internet Mail 6.0.35 Release) with SMTP; Thu, 18 Sep 2003 08:36:18 -0000 Received: from ema.hel.fi (ema.hel.fi [137.163.173.140]) by ema.hel.fi (8.11.7+Sun/8.11.2) with ESMTP id h8I8gMh16275 for ; Thu, 18 Sep 2003 11:42:22 +0300 (EEST) X-Map-MIXER-Originators: false To: freebsd-questions@freebsd.org From: "Karlsson Mikael HKI/SOSV" MIME-Version: 1.0 Date: 18 Sep 2003 11:41:00 +0300 Envelope-ID: JA8AAAAAAgFWOQABYQADV7qgzdhU@master.hel.fi Message-Id: X-Mailer: TeamWARE Connector for MIME Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Cat a directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 08:42:37 -0000 I've noticed along time that it's possible to cat a directory. I just don't see the point of it being possible to do so since it only returns jibrish. I know that in Linux for example cat returns an error message like this: cat: mail/: Is a directory. I also noticed that in both FreeBSD and Linux less returns the same error message. But vi and vim on the other hand returns=20fully readable and understandable text in both FreeBSD and Linux. What I just wanted to ask was if it's absolutely necessary for cat to be able to work on directories. Or if it would be possible to simply add a check to cat that tests if the "file" being opened is a directory and then exits with an error message if that is the case. The biggest problem for me as a "Unix"=20help-person at a company is to always explain to newbies and less experienced users not to cat directories as it usually scrambles or locks the whole terminal and as they then turn to me to undo their mistakes. These small simple things give our users=20bad thoughts about FreeBSD and often drives them to use other OSs!