Deutsch   English   Français   Italiano  
<uvbfml$2d8f0$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Rich <rich@example.invalid>
Newsgroups: comp.os.linux.misc
Subject: Re: Files tree
Date: Fri, 12 Apr 2024 14:15:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uvbfml$2d8f0$2@dont-email.me>
References: <uvba27$2c40q$1@dont-email.me> <slrnv1icg8.ei3.theise@panix2.panix.com>
Injection-Date: Fri, 12 Apr 2024 16:15:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2bc565714911136cbf268464d396b553";
	logging-data="2531808"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19OUITLrLNcxzDZhixIvcP4"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:9BRqgWlgkragy9m49921+LTcwaE=
Bytes: 1695

Ted Heise <theise@panix.com> wrote:
> On Fri, 12 Apr 2024 13:39:34 +0100,
>>  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?

Because 'find' is intended to be a filesystem traversal tool, and it 
includes the ability to exclude parts of the tree (the -path -prune 
invocations above exclude looking in those sub-trees).

'ls' is meant to display directories to humans, and it has only a 
rudimentary ability to walk the tree, and no ability to exclude parts 
of the tree you don't want to see.