"How can we recursively find all files with \ name in folder foo?"
Whenever someone tries to critique UNIX they always make up these nonsensical problems.
No UNIX user would intentionally name a file with a forward slash, a space, a semicolon, etc.
But I will play along.
To find these files, a number of ideas come to mind.
Maybe the easiest would be to use mtree to make a file specification and then search the specification.
Something like
mtree -cp /foo |exec mtree -C
Any forward slashes, spaces, or other nonsense in filenames would appear as octal values.
If there are so many files that these specifications become large enough to cause problems with UNIX utilities, I import them into a database like kdb.
Is there a way to hide files from mtree? Maybe.
But at least with the UNIX concept for a system, the user can look at the source and see how it works.
The truth is, UNIX is not so impressive.
It is only the fact that the alternative systems for doing the types of things one does with UNIX have always been inferior/rubbish in the opinion of a certain set of informed users.
It is this contrast that makes UNIX seem impressive.
As usual, the author makes no suggestion or detailed comparison of any other alternative that can be used for doing the tasks one does with UNIX.
He didn't even get the find command that he has such a distaste for correct:
> How can we recursively find all the files with \ name in a folder foo? The correct answer is: find foo -name '\\\\'
No, the correct answer:
% find foo -name '\\'
foo/\
> We need to write four backslashes here as UNIX shell performs backslash expanding, and find does it too.
The single quotes prevent the shell from performing escaping. Find does need escaping, and that's the only layer that does, so the correct answer has two backslashes.
Whenever someone tries to critique UNIX they always make up these nonsensical problems.
No UNIX user would intentionally name a file with a forward slash, a space, a semicolon, etc.
But I will play along.
To find these files, a number of ideas come to mind.
Maybe the easiest would be to use mtree to make a file specification and then search the specification.
Something like
Any forward slashes, spaces, or other nonsense in filenames would appear as octal values.If there are so many files that these specifications become large enough to cause problems with UNIX utilities, I import them into a database like kdb.
Is there a way to hide files from mtree? Maybe.
But at least with the UNIX concept for a system, the user can look at the source and see how it works.
The truth is, UNIX is not so impressive.
It is only the fact that the alternative systems for doing the types of things one does with UNIX have always been inferior/rubbish in the opinion of a certain set of informed users.
It is this contrast that makes UNIX seem impressive.
As usual, the author makes no suggestion or detailed comparison of any other alternative that can be used for doing the tasks one does with UNIX.