Skip site navigation (1)Skip section navigation (2)
Date:      18 Sep 2003 11:41:00 +0300
From:      "Karlsson Mikael HKI/SOSV" <mikael.karlsson@hel.fi>
To:        freebsd-questions@freebsd.org
Subject:   Cat a directory
Message-ID:  <JA8AAAAAAgFWOQABYQADV7qgzdhU@master.hel.fi>

next in thread | raw e-mail | index | archive | help
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!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?JA8AAAAAAgFWOQABYQADV7qgzdhU>