Listing disk/folder hierarchy contents to text file

Read this post. It basically says everything I had in mind to write :slight_smile:

For the lazy ones, we’re looking for something like this:

find . -name "myfile" && grep -v "Permission denied"

Thanks, DJ! “true” seems a bit less contrived that my “echo "\c"” suggestion. :slight_smile:

What a shame. She only abdicated a couple of days ago! :wink:

:slight_smile: it’s an bit of an odd/harsh saying but it’s the only saying or greet we have when the crown is given to the next generation without any time window between them. The title of queen for beatrix is dead, not the person luckely. Does Prince Charles ever going to be a king? No offence but he was, at least I think, the oldest prince at the ceremony.

Hello.

Here is one that is a bit more contrived, the philosophy is that the files is there, even if I don’t currently have the permissions to them.

find -H -L . -name \*.1  2>&1 |sed 's/: Permission denied//g'

(The -H and -L is for returning any info about the link, not what it points to.)

Maybe not when you are going to run a script over the result.

But then again, this should be faster:

 find  . -name \*.1  2>/dev/null

If there is any trouble with the exit code, then we can fake it for good measure:

 find  . -name \*.1  2>/dev/null || true

Good Luck with your new Kings, I am not very royalistic, but I dare say, that if you get something anywhere near ours, then your good! :slight_smile:

You really should test your code and your assertions before posting! :lol:

By itself, this searches the entire startup volume, which takes for ever.
After a cd to something a little shallower, it returns items whose names end with “.1”.
In the context of the script in post #11, it causes errors where there were none before.

:slight_smile:

I’m so sorry; I only meant to give examples and those were intended to find all “section 1” man files, and the snippets all do their job, flawlessly. I recommend using the last version with || true at the end, as it negates an exit code other than zero. (After you have changed the regexp (glob) to suit your needs of course.) :wink: