Re: Files tree

Liste des GroupesRevenir à col misc 
Sujet : Re: Files tree
De : theise (at) *nospam* panix.com (Ted Heise)
Groupes : comp.os.linux.misc
Date : 12. Apr 2024, 14:07:20
Autres entêtes
Organisation : My own, such as it is
Message-ID : <slrnv1icg8.ei3.theise@panix2.panix.com>
References : 1
User-Agent : slrn/1.0.3 (NetBSD)
On Fri, 12 Apr 2024 13:39:34 +0100,
  James Harris <james.harris.1@gmail.com> wrote:
 For a number of reasons I am looking for a way of recording a
 list of the files (and file-like objects) on a Unix system at
 certain points in time. The main output would simply be sorted
 text with one fully-qualified file name on each line.
 
 What follows is my first attempt at it. I'd appreciate any
 feedback on whether I am going about it the right way or
 whether it could be improved either in concept or in coding.
 
 There are two tiny scripts. In the examples below they write to
 temporary files f1 and f2 to test the mechanism but the idea is
 that the reports would be stored in timestamped files so that
 comparisons between one report and another could be made later.
 
 The first, and primary, script generates nothing other than
 names and is as follows.
 
 export LC_ALL=C
 sudo find /\
   -path "/proc/*" -prune -o\
   -path "/run/*" -prune -o\
   -path "/sys/*" -prune -o\
   -path "/tmp/*/*" -prune -o\
   -print0 | sort -z | tr '\0' '\n' > /tmp/f1

I know just enough linux admin to be dangerous so this is probably
a dumb question, but I'm wondering why use find rather than ls?

--
Ted Heise      <theise@panix.com>       West Lafayette, IN, USA

Date Sujet#  Auteur
12 Apr 24 * Files tree25James Harris
12 Apr 24 +* Re: Files tree3Ted Heise
12 Apr 24 i`* Re: Files tree2Rich
12 Apr 24 i `- Re: Files tree1Ted Heise
12 Apr 24 +* Re: Files tree6vallor
12 Apr 24 i+- Re: Files tree1Rich
13 Apr 24 i`* Re: Files tree4Lawrence D'Oliveiro
13 Apr 24 i `* Re: Files tree3Andy Burns
13 Apr 24 i  `* Re: Files tree2Lawrence D'Oliveiro
15 Apr 24 i   `- Re: Files tree1candycanearter07
12 Apr 24 +* Re: Files tree6Rich
12 Apr 24 i+- Re: Files tree1vallor
13 Apr 24 i+- Re: Files tree1Lawrence D'Oliveiro
20 Apr 24 i`* Re: Files tree3James Harris
20 Apr 24 i +- Re: Files tree1Rich
21 Apr 24 i `- Re: Files tree1Lawrence D'Oliveiro
12 Apr 24 +* Re: Files tree5Borax Man
13 Apr 24 i`* Re: Files tree4Lawrence D'Oliveiro
13 Apr 24 i `* Re: Files tree3Borax Man
13 Apr 24 i  `* Re: Files tree2Lawrence D'Oliveiro
15 Apr 24 i   `- Re: Files tree1candycanearter07
12 Apr 24 +- Re: Files tree1David W. Hodgins
13 Apr 24 `* Re: Files tree3Lawrence D'Oliveiro
13 Apr 24  `* Re: Files tree2The Natural Philosopher
14 Apr 24   `- Re: Files tree1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal