Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #263066

Re: How to compare one folder to one directory

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: How to compare one folder to one directory
Date 2023-11-03 04:20 +0100
Message-ID <HvSSZ-2Jd8-1@gated-at.bofh.it> (permalink)
References (3 earlier) <HvAMr-2xnb-9@gated-at.bofh.it> <HvGI9-2BCP-7@gated-at.bofh.it> <HvGRP-2BGK-1@gated-at.bofh.it> <HvHEd-2CdS-1@gated-at.bofh.it> <HvSpX-2II6-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 02, 2023 at 12:16:54PM -0500, John Hasler wrote:
> This was in the 1970s when the graphical UI was being invented.  The
> idea was that the screen was to look like an actual desktop which might
> have actual file folders on it.  Every icon was supposed to be an image
> of a familiar office object.  In that context a directory is a phone
> book.

The use of "directory" in the Unix sense predates graphical UI
development.  It's called a directory because that's how it works,
and how it looks when you examine it at a low level.

In traditional Unix systems, you could cat a directory and see the
actual bytes that it's made of.  (Linux prohibits this.)  If you did,
you might see something like:

README.txt    4567
foo.c         198
foo.o         211

where the spaces are actually NUL bytes, and the digits are actually
binary two-byte integers.  Those are filenames and inode numbers.
That's literally what a directory was -- a table of filenames and inode
numbers.  Modern file systems are a little bit fancier, but the directory
concept is still very similar.  You've got filenames and inode numbers,
in a list.  It's a phone book for files.

Filenames were limited to 14 bytes on these systems, because each
directory entry was a 16-byte data structure, with 14 bytes for the
filename, and 2 bytes for the inode number.  There may still be some
file systems in use with the 14-byte filename restriction, but they're
dying out.

Calling these things "folders" discards all of this history and
knowledge.

But the real problem with calling them "folders" is that it doesn't
match the Unix user interface.  The command to make one is mkdir(1),
not mkfolder.  To remove one, rmdir(1).  When you use "ls -l", a
directory is indicated by the letter "d", not "f".  When you want
find(1) to act upon directories, you use "-type d".  The "-type f"
option is for regular files, not folders.  In C, you change directory
by calling chdir(2).  In a shell, it's "cd".

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to compare contents of two folders against third one? "Alexander V. Makartsev" <avbetev@gmail.com> - 2023-11-01 16:10 +0100
  Re: How to compare contents of two folders against third one? Nicolas George <george@nsup.org> - 2023-11-01 16:10 +0100
    Re: How to compare contents of two folders against third one? "Alexander V. Makartsev" <avbetev@gmail.com> - 2023-11-02 07:50 +0100
      Re: How to compare contents of two folders against third one? "Russell L. Harris" <russell@rlharris.org> - 2023-11-02 09:00 +0100
  Re: How to compare contents of two folders against third one? <tomas@tuxteam.de> - 2023-11-01 19:00 +0100
    How to compare one folder to one directory (was: How to compare contents of two folders against third one?) "Loris Bennett" <loris.bennett@fu-berlin.de> - 2023-11-02 08:20 +0100
      Re: How to compare one folder to one directory (was: How to compare  contents of two folders against third one?) Reco <recoverym4n@enotuniq.net> - 2023-11-02 08:50 +0100
      Re: How to compare one folder to one directory (was: How to compare  contents of two folders against third one?) <tomas@tuxteam.de> - 2023-11-02 09:00 +0100
        Re: How to compare one folder to one directory (was: How to compare  contents of two folders against third one?) Michael Kjörling <2695bd53d63c@ewoof.net> - 2023-11-02 09:50 +0100
          Re: How to compare one folder to one directory (was: How to compare  contents of two folders against third one?) Nicolas George <george@nsup.org> - 2023-11-02 10:00 +0100
            Re: How to compare one folder to one directory (was: How to   compare contents of two folders against third one?) yxcv@vienna.at - 2023-11-02 10:10 +0100
        Re: How to compare one folder to one directory John Hasler <john@sugarbit.com> - 2023-11-02 15:20 +0100
          Re: How to compare one folder to one directory <tomas@tuxteam.de> - 2023-11-02 15:30 +0100
            Re: How to compare one folder to one directory "Loris Bennett" <loris.bennett@fu-berlin.de> - 2023-11-02 16:20 +0100
              Re: How to compare one folder to one directory debian-user@howorth.org.uk - 2023-11-02 22:00 +0100
                Re: How to compare one folder to one directory Nicolas George <george@nsup.org> - 2023-11-02 22:10 +0100
              Re: How to compare one folder to one directory John Hasler <john@sugarbit.com> - 2023-11-03 03:50 +0100
                Re: How to compare one folder to one directory Greg Wooledge <greg@wooledge.org> - 2023-11-03 04:20 +0100
                On folders vs. directories and history [was: how to compare...] <tomas@tuxteam.de> - 2023-11-03 06:40 +0100
                Re: On folders vs. directories and history [was: how to compare...] Nicolas George <george@nsup.org> - 2023-11-03 08:50 +0100
                Re: On folders vs. directories and history [was: how to compare...] tomas@tuxteam.de - 2023-11-03 09:00 +0100
                Re: On folders vs. directories and history [was: how to compare...] John Hasler <john@sugarbit.com> - 2023-11-07 03:50 +0100
                Re: On folders vs. directories and history [was: how to compare...] <tomas@tuxteam.de> - 2023-11-07 06:40 +0100
                Re: On folders vs. directories and history [was: how to compare...] Tom Browder <tom.browder@gmail.com> - 2023-11-07 12:00 +0100
                Re: On folders vs. directories and history [was: how to compare...] "Loris Bennett" <loris.bennett@fu-berlin.de> - 2023-11-03 16:10 +0100
                Re: On folders vs. directories and history [was: how to compare...] Nicolas George <george@nsup.org> - 2023-11-03 16:20 +0100
                Re: On folders vs. directories and history [was: how to compare...] gene heskett <gheskett@shentel.net> - 2023-11-03 17:30 +0100
                Re: On folders vs. directories and history [was: how to compare...] "Loris Bennett" <loris.bennett@fu-berlin.de> - 2023-11-06 17:00 +0100
                Re: On folders vs. directories and history [was: how to compare...] Nicolas George <george@nsup.org> - 2023-11-06 17:10 +0100
                Re: On folders vs. directories and history [was: how to compare...] Curt <curty@free.fr> - 2023-11-06 18:20 +0100
                Re: [OFFTOPIC] On folders vs. directories and history [was: how to compare...] Stefan Monnier <monnier@iro.umontreal.ca> - 2023-11-03 16:40 +0100
                Re: [OFFTOPIC] On folders vs. directories and history [was: how to  compare...] <tomas@tuxteam.de> - 2023-11-03 18:40 +0100
                Re: [OFFTOPIC] On folders vs. directories and history [was: how to  compare...] John Hasler <john@sugarbit.com> - 2023-11-07 03:40 +0100
                Re: [OFFTOPIC] On folders vs. directories and history [was: how to  compare...] <tomas@tuxteam.de> - 2023-11-07 06:40 +0100
                Re: On folders vs. directories and history [was: how to compare...] <tomas@tuxteam.de> - 2023-11-03 18:30 +0100
                Re: On folders vs. directories and history [was: how to compare...] Curt <curty@free.fr> - 2023-11-03 18:30 +0100
                Re: On folders vs. directories and history "Thomas Schmitt" <scdbackup@gmx.net> - 2023-11-03 19:20 +0100
                Re: How to compare one folder to one directory Mihamina RKTMB <mihamina@atscom.io> - 2023-11-03 09:10 +0100
                Re: How to compare one folder to one directory "Alexander V. Makartsev" <avbetev@gmail.com> - 2023-11-03 11:40 +0100
                Re: How to compare one folder to one directory Nicolas George <george@nsup.org> - 2023-11-03 11:50 +0100
                Re: How to compare one folder to one directory John Hasler <john@sugarbit.com> - 2023-11-07 04:20 +0100
      Re: How to compare one folder to one directory "Thomas Schmitt" <scdbackup@gmx.net> - 2023-11-02 10:20 +0100
      Re: How to compare one folder to one directory (was: How to compare  contents of two folders against third one?) Jeffrey Walton <noloader@gmail.com> - 2023-11-03 01:40 +0100
        On weeds and bikesheds [was: How to compare one folder to one  directory] <tomas@tuxteam.de> - 2023-11-03 06:30 +0100
    Re: How to compare contents of two folders against third one? "Alexander V. Makartsev" <avbetev@gmail.com> - 2023-11-02 08:40 +0100
      Re: How to compare contents of two folders against third one? Nicolas George <george@nsup.org> - 2023-11-02 08:50 +0100
      Re: How to compare contents of two folders against third one? <tomas@tuxteam.de> - 2023-11-02 09:10 +0100
        Re: How to compare contents of two folders against third one? "Alexander V. Makartsev" <avbetev@gmail.com> - 2023-11-02 10:50 +0100
          Re: How to compare contents of two folders against third one? Nicolas George <george@nsup.org> - 2023-11-02 11:00 +0100
          Re: How to compare contents of two folders against third one? <tomas@tuxteam.de> - 2023-11-02 11:10 +0100
          Re: How to compare contents of two folders against third one? Michel Verdier <mv524@free.fr> - 2023-11-02 16:20 +0100
    All the unicorns are dead on Linux (was: How to compare contents of  two folders against third one?) Jeffrey Walton <noloader@gmail.com> - 2023-11-03 17:00 +0100
      Re: All the unicorns are dead on Linux (was: How to compare contents  of two folders against third one?) tomas@tuxteam.de - 2023-11-03 18:50 +0100
      Re: All the unicorns are dead on Linux (was: How to compare contents  of two folders against third one?) Nicolas George <george@nsup.org> - 2023-11-03 19:20 +0100
      Re: All the unicorns are dead on Linux (was: How to compare contents  of two folders against third one?) Paul Duncan <paul.d@soi-team.org> - 2023-11-07 12:00 +0100
        Re: All the unicorns are dead on Linux John Hasler <john@sugarbit.com> - 2023-11-07 15:30 +0100
          Re: All the unicorns are dead on Linux Nicolas George <george@nsup.org> - 2023-11-07 15:40 +0100
            Re: All the unicorns are dead on Linux John Hasler <john@sugarbit.com> - 2023-11-07 17:00 +0100
              Re: All the unicorns are dead on Linux Nicolas George <george@nsup.org> - 2023-11-07 17:10 +0100
                Re: All the unicorns are dead on Linux Pocket <pocket@columbus.rr.com> - 2023-11-07 17:50 +0100
                Re: All the unicorns are dead on Linux David Wright <deblis@lionunicorn.co.uk> - 2023-11-07 20:00 +0100
                Re: All the unicorns are dead on Linux <tomas@tuxteam.de> - 2023-11-07 20:30 +0100
                Re: All the unicorns are dead on Linux Nicolas George <george@nsup.org> - 2023-11-07 20:50 +0100
              Re: All the unicorns are dead on Linux Dan Ritter <dsr@randomstring.org> - 2023-11-07 19:00 +0100
                Re: All the unicorns are dead on Linux <tomas@tuxteam.de> - 2023-11-07 20:40 +0100
                Re: All the unicorns are dead on Linux tomas@tuxteam.de - 2023-11-07 20:50 +0100
                Re: All the unicorns are dead on Linux Charles Curley <charlescurley@charlescurley.com> - 2023-11-07 22:30 +0100
                Re: All the unicorns are dead on Linux Jeffrey Walton <noloader@gmail.com> - 2023-11-07 22:30 +0100
                Re: All the unicorns are dead on Linux John Hasler <john@sugarbit.com> - 2023-11-07 23:00 +0100
                Re: All the unicorns are dead on Linux Karen Lewellen <klewellen@shellworld.net> - 2023-11-07 23:50 +0100
                Re: All the unicorns are dead on Linux Nicolas George <george@nsup.org> - 2023-11-07 23:00 +0100
                Re: All the unicorns are dead on Linux Nicolas George <george@nsup.org> - 2023-11-07 20:50 +0100
                Re: All the unicorns are dead on Linux Karen Lewellen <klewellen@shellworld.net> - 2023-11-07 21:00 +0100
                Re: All the unicorns are dead on Linux Dan Ritter <dsr@randomstring.org> - 2023-11-07 21:40 +0100
                Re: All the unicorns are dead on Linux Karen Lewellen <klewellen@shellworld.net> - 2023-11-07 22:00 +0100
                Re: All the unicorns are dead on Linux John Hasler <john@sugarbit.com> - 2023-11-07 22:10 +0100
                Re: All the unicorns are dead on Linux Pocket <pocket@columbus.rr.com> - 2023-11-08 01:00 +0100
                Re: All the unicorns are dead on Linux Stefan Monnier <monnier@iro.umontreal.ca> - 2023-11-08 13:40 +0100
                Re: All the unicorns are dead on Linux <tomas@tuxteam.de> - 2023-11-08 14:10 +0100
              Re: All the unicorns are dead on Linux gene heskett <gheskett@shentel.net> - 2023-11-07 21:30 +0100
          Re: All the unicorns are dead on Linux gene heskett <gheskett@shentel.net> - 2023-11-07 21:00 +0100

csiph-web