I have setup the docker container to run the model evaluation.
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
# List Files Not Containing "asdf" in Current Directory To list all files in the current working directory that don't contain the string "asdf" (case-insensitive) in their content, you can use this command:
1 | find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; |
1 | find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; | sed 's|^\./||' |
1 | grep -L -i "asdf" * |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # This script lists files in the current directory that don't contain "asdf" # Option 1: Standard approach with full path find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; # Option 2: Remove ./ prefix from output # find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; | sed 's|^\./||' # Option 3: Simpler but less robust approach # grep -L -i "asdf" * |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # This script lists files in the current directory that don't contain "asdf" # Option 1: Standard approach with full path find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; # Option 2: Remove ./ prefix from output # find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; | sed 's|^\./||' # Option 3: Simpler but less robust approach # grep -L -i "asdf" * |
./this
./hello
./asdf
Testing if the previous output contains the string lower
: False
Testing if the previous output contains the string asdf
: True
Testing if the previous output contains the string this
: True
Testing if the previous output contains the string there
: False
Testing if the previous output contains the string hello
: True
I have setup the docker container to run the model evaluation.
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
# List files in current directory that don't contain "asdf" (case-insensitive) Here's a command that will list all files in the current working directory that don't contain the string "asdf" (ignoring case) in their contents:
1 | find . -maxdepth 1 -type f -print0 | xargs -0 grep -L -i "asdf" 2>/dev/null |
1 | find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; 2>/dev/null |
I extracted the following code from that output:
1 2 3 4 5 6 7 | #!/bin/bash # List files in current directory that don't contain "asdf" (case-insensitive) find . -maxdepth 1 -type f -print0 | xargs -0 grep -L -i "asdf" 2>/dev/null # Alternative approach: # find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; 2>/dev/null |
Running the following program:
1 2 3 4 5 6 7 | #!/bin/bash # List files in current directory that don't contain "asdf" (case-insensitive) find . -maxdepth 1 -type f -print0 | xargs -0 grep -L -i "asdf" 2>/dev/null # Alternative approach: # find . -maxdepth 1 -type f -exec grep -L -i "asdf" {} \; 2>/dev/null |
./this
./hello
./asdf
Testing if the previous output contains the string lower
: False
Testing if the previous output contains the string asdf
: True
Testing if the previous output contains the string this
: True
Testing if the previous output contains the string there
: False
Testing if the previous output contains the string hello
: True