4 ms·
I'm curious how the example shelly 'find "class" in files in this directory without the .venv dir' is interpreted. I'm assuming something like: grep -l -
by eesmith 3y ago
I'm curious how the example
shelly 'find "class" in files in this directory without the .venv dir'
is interpreted. I'm assuming something like:
grep -l -R --exclude-dir .venv class
and possibly with the "--null" option, but I can also see how using "find" suggests the user is thinking of the find command, so wants filenames containing the substring "class" but not in the .venv directory. My first attempt at that is:
find . -name '*class*' | grep -Fv '/.venv/'
- paletov 3y agoCurrently it returns: grep -r --exclude-dir=.venv "class" .
- eesmith 3y agoAhh, so also report the line where it's found, and not the file. Also reasonable. I see the documentation now shows the expansion, which is nice. It's interesting how 'check size of files in this directory but format it with gb/mb, etc' is converted to "du -sh *" while my Mac's "man du" has this: Show disk usage for all files in the current directory. Output is in human-readable form: # du -ah I point it out because the author of the man page intends for "all files in the current directory" to include files in subdirectories, and for all dot files, while OpenAI GPT version only shows info for non-dot files, and only in the top-level directory. (There will also be an issue if there are too many files for "*" expansion.) OTOH, "'find "class" in files in this directory without the .venv dir'" uses a recursive grep, which means that "in this directory" here is taken to include subdirectories ... which the poser of the question clearly intended as otherwise "without the .venv dir" does not make sense. Still, one "files in this directory" in one case includes dot files while the other does not, which is a subtle inconsistency.