Linux related questions
Recently I've been learning a fair bit about commands and stuff in Linux, but also stumbled upon some difficulties on the way.
Basically, I have a 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, but it's been very interesting and challenging. Hopefully there are others out there who are familiar with Linux, as well.
Assuming this is for awk.
Then as far as I remember [aZ] is a single character wild-card that matches either an 'a' or a 'Z'
To make it a range, you must put a dash in it like [a-z]
And mixing case might work(I've never tried it), but is ambiguous and therefore I do not advise it.
Better would be '/[a-zA-Z]'
or
'/[[:alpha:]]'
P.S. I would not consider myself to be a Linux expert, so use my advice at your own risk
Then as far as I remember [aZ] is a single character wild-card that matches either an 'a' or a 'Z'
To make it a range, you must put a dash in it like [a-z]
And mixing case might work(I've never tried it), but is ambiguous and therefore I do not advise it.
Better would be '/[a-zA-Z]'
or
'/[[:alpha:]]'
P.S. I would not consider myself to be a Linux expert, so use my advice at your own risk
Thanks for your input - was a bit thrown off as to why the command had "a" and "Z" in it, but without the "-", etc.. Would have thought it meant any letters of any case. Appreciated your thoughts and suggestions!
Any ideas on what the "*" and "?" in the file extension would do? Would it be the same as if it had been used for the start of the file (bring up a range of file endings depending on what characters are used)?
That's correct. When searching for a file, the file-system doesn't really care about root-names and extensions, it just treats the "dot" as it would any other character in the search string.
_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.
That's correct. When searching for a file, the file-system doesn't really care about root-names and extensions, it just treats the "dot" as it would any other character in the search string.
Okay, thanks!
Similar Topics | |
---|---|
Any linux people can help me? |
16 Feb 2024, 10:05 am |
Civil suits related to insurrection |
17 Feb 2024, 2:29 am |
Unlocking the Secrets Behind Age-Related Memory Loss |
01 Apr 2024, 5:08 pm |
Random Questions |
21 Apr 2024, 8:31 am |