outlier
New Member
Posts: 27
Likes: 17
Meta-Ethnicity: Celto-Germanic
Ancestry: Scottish, British, & Eastern European
|
Post by outlier on Nov 16, 2018 2:00:46 GMT
What does "grep ERROR filename.txt" and "grep ERROR filename.txt > errors.txt" mean? I'm still trying to understand all this stuff, but have had particular trouble figuring these out as I haven't been able to find any explanations anywhere.
If anyone has an idea, feel free to share - in the mean time, I'll keep looking into things.
|
|
|
Post by Elizabeth on Nov 16, 2018 4:05:16 GMT
I believe that you tried to create an expression to search within a given filename and the result yielded nothing. That's all I can think of Shrug
|
|
|
Post by fschmidt on Nov 16, 2018 4:06:50 GMT
|
|
outlier
New Member
Posts: 27
Likes: 17
Meta-Ethnicity: Celto-Germanic
Ancestry: Scottish, British, & Eastern European
|
Post by outlier on Nov 16, 2018 5:44:28 GMT
Thanks! That explains it perfectly. Probably going to keep running into things like this, so thanks also for linking the book.
|
|
outlier
New Member
Posts: 27
Likes: 17
Meta-Ethnicity: Celto-Germanic
Ancestry: Scottish, British, & Eastern European
|
Post by outlier on Nov 16, 2018 7:29:31 GMT
Just another quick question regarding the ls command - what would [aZ] mean? List both uppercase and lowercase letters ranging from a to z? Or specifically a and Z? I'm pretty sure it's my first assumption, but always better to check than to spend the next few months unsure. I also have come across ls commands where the file written in the command ends with .t*t or even t*? - I didn't know this could be done with the end of a file? I thought there were only a limited and specific amount of characters used for the end of a file?
I've still got much to learn. Hopefully it's straight forward once I begin to understand what all the commands mean.
|
|
|
Post by fschmidt on Nov 16, 2018 7:48:42 GMT
"[aZ]" has nothing to do with Unix. It's just some convention of whatever documentation you are using.
"*" has nothing to do with ls. It is expanded by the shell to match any text in a file name. So "*.txt" would match any file name ending with ".txt". The shell then passes this list to ls. You can see this by using the "echo" command which just echos back its arguments. So "echo whatever" will print "whatever". But "echo *.txt" will echo back all file names that match and were generated by the shell. Conversely putting an argument in single quotes prevents shell expansion. So "ls '*.txt'" will actually pass "*.txt" to ls which then won't find it.
|
|
outlier
New Member
Posts: 27
Likes: 17
Meta-Ethnicity: Celto-Germanic
Ancestry: Scottish, British, & Eastern European
|
Post by outlier on Nov 16, 2018 19:30:35 GMT
"[aZ]" has nothing to do with Unix. It's just some convention of whatever documentation you are using. "*" has nothing to do with ls. It is expanded by the shell to match any text in a file name. So "*.txt" would match any file name ending with ".txt". The shell then passes this list to ls. You can see this by using the "echo" command which just echos back its arguments. So "echo whatever" will print "whatever". But "echo *.txt" will echo back all file names that match and were generated by the shell. Conversely putting an argument in single quotes prevents shell expansion. So "ls '*.txt'" will actually pass "*.txt" to ls which then won't find it. Hmm, okay. I might have to have a closer look at what this command does. But thanks for clearing up the those two things for me.
|
|