• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Any advantages of Unix formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any advantages of Unix formatting


  • Subject: Re: Any advantages of Unix formatting
  • From: Jonathan Stimmel <email@hidden>
  • Date: Tue, 4 Sep 2001 17:45:59 -0700
  • Mail-followup-to: Jonathan Stimmel <email@hidden>, email@hidden

On Tue, Sep 04, 2001 at 07:24:25PM -0500, Jonathan Hendry wrote:

> On Tuesday, September 4, 2001, at 05:32 , John C. Randolph wrote:
> > Interesting that the output of ls doesn't show the actual name in the
> > filesystem, but rather the name I typed on the command line.
>
> It doesn't work with regexes, etc. F* won't catch foo.

Technically, those are "file globs", not "regular expressions",
but either way the shell does the work, not ls. Assuming you have
multiple files starting with "a", try:
ls 'a*'
The single quotes prevent the shell from globbing, and so ls
looks for a file named (exactly) "a*" (which it probably won't
find). On my OS X box, I installed bash (never been a big fan
of (t)csh) and have turned on case insensitive globbing to
match my filesystems ("set completion-ignore-case on" in
~/.inputrc).


> On a tangent, I've noticed that ls reports sizes in bytes,
> but Finder reports sizes in multiples of 4k.
>
> A file containing 'a' is reported as 1 byte in ls, but
> 4k by Finder. It doesn't have a resource fork, though.
>
> I wonder which is more accurate.

They're both correct, in their own way. In order to be able to
perform efficiently, all filesystems waste some space. "ls"
is reporting the actual length of the file (one byte), whereas
the number you quote is the amount of disk spae allocated for
the file (4k, or one block). You can use "du" to determine
a file's "d"isk "u"sage. "du file" will normally tell you how
many blocks the file takes up, and "du -k file" will translate
blocks into KB.


References: 
 >Re: Any advantages of Unix formatting (From: "John C. Randolph" <email@hidden>)
 >Re: Any advantages of Unix formatting (From: Jonathan Hendry <email@hidden>)

  • Prev by Date: Re: Any advantages of Unix formatting
  • Next by Date: Re: CFRunLoop
  • Previous by thread: Re: Any advantages of Unix formatting
  • Next by thread: Re: Any advantages of Unix formatting
  • Index(es):
    • Date
    • Thread