Answer the question
In order to leave comments, you need to log in
What happens when you type an asterisk (*) into a unix terminal?
Hey!
Who will explain normally, or give a link where it is described. What happens when you enter the command (*) in linux.
As I understand it, it takes all the files in a row and executes them in a row. There only names of files are considered? Or somehow the content also affects something. How does it all work?
Answer the question
In order to leave comments, you need to log in
If the shell encounters the character *, then it treats it as a wildcard character.
If it is a pattern character, then it takes the characters around it, making up the pattern.
When the template is composed, it takes all the names in the current directory in order and compares against this template.
All names that match the pattern are inserted with a space instead of the pattern.
And then the whole thing gets done.
That's an example
[[email protected] t]$ ls
[[email protected] t]$ touch cat
[[email protected] t]$ echo hello >file.txt
[[email protected] t]$ ll
итого 4
-rw-rw-r--. 1 guest guest 0 дек 30 11:32 cat
-rw-rw-r--. 1 guest guest 6 дек 30 11:32 file.txt
[[email protected] t]$ *
hello
[[email protected] t]$
What happens when you enter the command (*) in linux.
yes * replaces the full name, eg rm *.txt will delete all files with .txt extension,
is there more like ? which replaces only one character e.g. ?ello i.e. will delete all files whose first character is arbitrary, and the rest, respectively, ello.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question