Why does the ^ character expand to "begins with" in the command ls -a | grep '^\.' while it does expand to the opposite when it is being used in rm [^s]* ?
If the ^ is at the start pd a string then we are saying any character followed by the string. If it st the end of the string then we srae saying a string followed by any character
If I understand correctly the backslash infront of a special character works the same as single quotes would by eliminating any protection that character has. In regards to it's function. Example: ls [\!]* ls ['!']* Is my understanding correct? as the results of both commands are the same.
You have not moved the file across @ 11:52 but you have renamed it ..
Why does the ^ character expand to "begins with" in the command ls -a | grep '^\.' while it does expand to the opposite when it is being used in rm [^s]* ?
If the ^ is at the start pd a string then we are saying any character followed by the string. If it st the end of the string then we srae saying a string followed by any character
Thank you, sir!
If I understand correctly the backslash infront of a special character works the same as single quotes would by eliminating any protection that character has. In regards to it's function.
Example:
ls [\!]*
ls ['!']*
Is my understanding correct? as the results of both commands are the same.
+anglojojo yes. \ protects the following character from shell expansion. The single quotes protect all characters quoted from shell expansion
+Andrew Mallett Thanks for connecting the last dot in my brain :)
Do you know where I can find a some practice tests for the LPI's Linux Essential?