Ed_P wrote: ↑16 Oct 2023, 06:46
I see less lines but I don't see an .sh.

And grep -- '-2023 ' testdisk.log | grep -i .. ".sh "didn't work either.
Could it be you defeated yourself by using Dr. Copy and Mr. Paste?
Why is there a whitespace at the end of grep -i .. ".sh " ?
And what is the ".." meant to be?
Could it be you meant to use a simple
| grep ".sh"
Though, be aware that for grep executed likes so the "." in the ".sh" statement is meant as "any character",
you have to escape the "." to make grep search for a literal ".".
──────────────────────────────────────────────────────────
Ed_P wrote: ↑16 Oct 2023, 06:46
Now that this step is resolved do you have any suggestions for my wanting to use multiple selections when reading the log file? I want the -2023 lines plus .sh lines and .jpg lines.
What do you mean by "use multiple selections when reading the log file"
You can add a grep onto a grep:
would find all and any entries of "Azur Lane"
Let's presume "index.txt" is created using find and thus has entries like so:
Code: Select all
/Random Folder/whatever.file
/sound/Azur Lane/fan-music.mp3
/video/Azur Lane/Azur Lane 01.mp4
/video/Kantai Collection/Kantai Collection 01.mp4
When you
only want to find all entries for "Azur Lane"
and "/video/" then you use | and another grep like so:
Code: Select all
grep "Azur Lane" index.txt | grep "/video/"
When you want to find all "Azur Lane" hits
but the "/video/" ones you use -v (Cave! In grep
-v is not the same as
-V and --version) like so:
Code: Select all
grep "Azur Lane" index.txt | grep -v "/video/"
And when you want to
combine several search patterns use -E like so to find all entries named "Azur Lane" and "Kantai Collection":
Code: Select all
grep -E "Azur Lane|Kantai Collection" index.txt
Examples:
Code: Select all
guest@rava:/tmp$ cat index.txt
/Random Folder/whatever.file
/sound/Azur Lane/fan-music.mp3
/video/Azur Lane/Azur Lane 01.mp4
/video/Kantai Collection/Kantai Collection 01.mp4
guest@rava:/tmp$ grep -E "Azur Lane|Kantai Collection" index.txt
/sound/Azur Lane/fan-music.mp3
/video/Azur Lane/Azur Lane 01.mp4
/video/Kantai Collection/Kantai Collection 01.mp4
guest@rava:/tmp$ grep "Azur Lane" index.txt | grep "/video/"
/video/Azur Lane/Azur Lane 01.mp4
guest@rava:/tmp$ grep "Azur Lane" index.txt | grep -v "/video/"
/sound/Azur Lane/fan-music.mp3
guest@rava:/tmp$
If none of this is what you meant, please explain what you meant by "use multiple selections when reading the log file".