This command will serach files in working directory but only this which begin at letter a and will copy them ({}-list files to copy) to directory which is called namedirectory.
If you would like to find In file lines matching a pattern use command grep. Next to grep write pattern and then name of a file.
owi@laptop:~$ grep root /etc/passwd
In file /etc/passwd will be found the lines where is Word Root. This commond will printf them. If you would like to find only the lines where first word is root at the begin of the pattern write symbol “^”.
owi@laptop:~$ grep ^root /etc/passwd
If you would like to know the number of lines where is word root use command grep –c.
owi@laptop:~$ grep -c ^root /etc/passwd
If you want to see only lines which don’t have a searching pattern use flag –v.
owi@laptop:~$ grep -v ^root /etc/passwd
Autor: Aleksandra Przybyło aleksandraprzybylo@gmail.com
Akademia Górniczo-Hutnicza Wydział Geologii, Geofizyki i Ochrony Środowiska Informatyka Stosowana